~ubuntu-branches/ubuntu/raring/python-qt4/raring-proposed

« back to all changes in this revision

Viewing changes to doc/html/qml.html

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2013-01-07 09:26:35 UTC
  • mfrom: (1.5.13) (4.2.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130107092635-7qcg712heele9p9a
Tags: 4.9.6-1ubuntu1
* Fix compiling Qt Designer plugin with multiarched python.
* Unify build targets across py2 & 3, both now multiarched.
* Enable DEB_BUILD_OPTIONS compliant parallel build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
  <head>
9
9
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
10
    
11
 
    <title>Integrating Python and QML &mdash; PyQt 4.9.5 Reference Guide</title>
 
11
    <title>Integrating Python and QML &mdash; PyQt 4.9.6 Reference Guide</title>
12
12
    
13
13
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
14
14
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
16
16
    <script type="text/javascript">
17
17
      var DOCUMENTATION_OPTIONS = {
18
18
        URL_ROOT:    '',
19
 
        VERSION:     '4.9.5',
 
19
        VERSION:     '4.9.6',
20
20
        COLLAPSE_INDEX: false,
21
21
        FILE_SUFFIX: '.html',
22
22
        HAS_SOURCE:  true
26
26
    <script type="text/javascript" src="_static/underscore.js"></script>
27
27
    <script type="text/javascript" src="_static/doctools.js"></script>
28
28
    <link rel="shortcut icon" href="_static/logo_tn.ico"/>
29
 
    <link rel="top" title="PyQt 4.9.5 Reference Guide" href="index.html" />
 
29
    <link rel="top" title="PyQt 4.9.6 Reference Guide" href="index.html" />
30
30
    <link rel="next" title="Integrating Python and JavaScript in QtWebKit" href="webkit.html" />
31
31
    <link rel="prev" title="Support for QSettings" href="pyqt_qsettings.html" /> 
32
32
  </head>
46
46
        <li class="right" >
47
47
          <a href="pyqt_qsettings.html" title="Support for QSettings"
48
48
             accesskey="P">previous</a> |</li>
49
 
        <li><a href="index.html">PyQt 4.9.5 Reference Guide</a> &raquo;</li> 
 
49
        <li><a href="index.html">PyQt 4.9.6 Reference Guide</a> &raquo;</li> 
50
50
      </ul>
51
51
    </div>  
52
52
 
60
60
<p>Qt v4.7 introduced QML as a means of declaratively describing a user interface
61
61
and using JavaScript as a scripting language within QML.  It is possible to
62
62
write complete standalone QML applications, or to combine them with C++.</p>
63
 
<p>PyQt supports the integration of Python and QML as far as it can - given the
 
63
<p>PyQt4 supports the integration of Python and QML as far as it can - given the
64
64
limitations of the QML implementation.</p>
65
65
<p>There are three types of QML application:</p>
66
66
<ul class="simple">
67
67
<li><em>Pure</em> applications that are written entirely in QML and can be run using the
68
 
<strong class="program">qmlviewer</strong> tool provided with Qt.  PyQt fully supports this type of
69
 
application.  The examples provided by <strong class="program">qtdemo.py</strong> under the <em>Qt
 
68
<strong class="program">qmlviewer</strong> tool provided with Qt.  PyQt4 fully supports this type
 
69
of application.  The examples provided by <strong class="program">qtdemo.py</strong> under the <em>Qt
70
70
Declarative Examples</em> heading are all of this type.</li>
71
71
<li>QML allows <tt class="docutils literal"><span class="pre">QObject</span></tt> instances to be used in QML applications.  QML code is
72
72
able to call an object&#8217;s slots and has read and write access to the object&#8217;s
73
73
properties.  QML code can also respond to changes to the value of a property.
74
 
PyQt fully supports the use objects created in Python in this way.  The
 
74
PyQt4 fully supports the use objects created in Python in this way.  The
75
75
<strong class="program">minehunt.py</strong> example under the <em>Demonstrations</em> heading of
76
76
<strong class="program">qtdemo.py</strong> is an example of this type of application.</li>
77
77
<li>QML also allows <tt class="docutils literal"><span class="pre">QObject</span></tt> sub-classes to be used in QML applications so
78
 
that new instances are created from QML.  PyQt does not support this.  The
 
78
that new instances are created from QML.  PyQt4 does not support this.  The
79
79
reason is that QML uses information generated at compile time (specifically
80
80
it uses <tt class="docutils literal"><span class="pre">QObject::staticMetaObject</span></tt>) rather than information created
81
81
dynamically at run time (i.e. <tt class="docutils literal"><span class="pre">QObject::metaObject()</span></tt>).  This approach is
84
84
place any restriction on the functionality of a Python/QML application, it
85
85
only places restrictions on how that application is written.</li>
86
86
</ul>
87
 
<p>QML can implement JavaScript functions and define signals.  PyQt allows both of
88
 
these to be accessed transparently from Python.  The following is a simple
 
87
<p>QML can implement JavaScript functions and define signals.  PyQt4 allows both
 
88
of these to be accessed transparently from Python.  The following is a simple
89
89
example application that displays the current date and time when the user
90
90
clicks on it.</p>
91
91
<p>The following is the QML (in the <tt class="file docutils literal"><span class="pre">message.qml</span></tt>) that defines the user
218
218
        <li class="right" >
219
219
          <a href="pyqt_qsettings.html" title="Support for QSettings"
220
220
             >previous</a> |</li>
221
 
        <li><a href="index.html">PyQt 4.9.5 Reference Guide</a> &raquo;</li> 
 
221
        <li><a href="index.html">PyQt 4.9.6 Reference Guide</a> &raquo;</li> 
222
222
      </ul>
223
223
    </div>
224
224
    <div class="footer">