##// END OF EJS Templates
updated docs...
florianlink -
r121:24aa8fbcea45
parent child
Show More
@@ -1,7 +1,7
1 PythonQt
1 PythonQt
2 --------
2 --------
3
3
4 PythonQt is a dynamic Python (http://www.python.org) binding for Qt (http://www.trolltech.com).
4 PythonQt is a dynamic Python (http://www.python.org) binding for Qt (http://qt.nokia.com).
5 It offers an easy way to embed the Python scripting language into
5 It offers an easy way to embed the Python scripting language into
6 your Qt applications. It makes heavy use of the QMetaObject system and thus requires Qt4.x.
6 your Qt applications. It makes heavy use of the QMetaObject system and thus requires Qt4.x.
7
7
@@ -11,8 +11,7 PythonQt is distributed under the LGPL 2.1 license.
11
11
12 Licensing of Generator
12 Licensing of Generator
13 ----------------------
13 ----------------------
14 The build system of PythonQt makes use of a patched version of the LGPL'ed QtScript generator,
14 The build system of PythonQt makes use of a patched version of the LGPL'ed QtScript generator, located in the "generator" directory.
15 located in the "generator" directory.
16
15
17 See the LICENSE.LGPL file in the generator subdirectory for details.
16 See the LICENSE.LGPL file in the generator subdirectory for details.
18 Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
17 Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
@@ -20,9 +19,8 Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
20 See http://qt.gitorious.org/qt-labs/qtscriptgenerator for the original project.
19 See http://qt.gitorious.org/qt-labs/qtscriptgenerator for the original project.
21 The PythonQt wrappers generated by the generator are distributed under the LGPL as well.
20 The PythonQt wrappers generated by the generator are distributed under the LGPL as well.
22
21
23
22 The generated wrappers are pre-generated and checked-in for Qt 4.6.1, so you only need to build and run the
24 The generated wrappers are pre-generated and checked-in for Qt 4.4.3, so you only need to build and run the
23 generator when you want to build additional wrappers or you want to upgrade/downgrade to another Qt version, but this requires updating the typesystems as well.
25 generator when you want to build additional wrappers or you want to upgrade/downgrade to an newer Qt version.
26
24
27 Documentation
25 Documentation
28 -------------
26 -------------
@@ -51,13 +51,13
51
51
52 \section Introduction
52 \section Introduction
53
53
54 \b PythonQt is a dynamic Python (http://www.python.org) binding for Qt (http://www.qtsoftware.com).
54 \b PythonQt is a dynamic Python (http://www.python.org) binding for the Qt framework (http://qt.nokia.com).
55 It offers an easy way to embed the Python scripting language into
55 It offers an easy way to embed the Python scripting language into
56 your Qt applications. It makes heavy use of the QMetaObject system and thus requires Qt4.x.
56 your C++ Qt applications. It makes heavy use of the QMetaObject system and thus requires Qt4.x.
57
57
58 The focus of PythonQt is on embedding Python into an existing C++ application, not on writing the whole
58 The focus of PythonQt is on embedding Python into an existing C++ application, not on writing the whole
59 application completely in Python. If you want to write your whole application in Python,
59 application completely in Python. If you want to write your whole application in Python,
60 you should use <a href="http://www.riverbankcomputing.co.uk/pyqt/">PyQt</a> instead.
60 you should use <a href="http://www.riverbankcomputing.co.uk/pyqt/">PyQt</a> or <a href="http://www.pyside.org">PySide</a> instead.
61
61
62 If you are looking for a simple way to embed Python objects into your C++/Qt Application
62 If you are looking for a simple way to embed Python objects into your C++/Qt Application
63 and to script parts of your application via Python, PythonQt is the way to go!
63 and to script parts of your application via Python, PythonQt is the way to go!
@@ -85,12 +85,12
85 Thanks a lot to the QtJambi guys and the QtScript Generator project for the C++ parser and
85 Thanks a lot to the QtJambi guys and the QtScript Generator project for the C++ parser and
86 Qt typesystem files!
86 Qt typesystem files!
87
87
88 The PythonQt wrappers generated by the generator located in the "generated_cpp" directory are distributed under the LGPL as well.
88 The PythonQt wrappers generated by the generator located in the "generated_cpp" directory are free to be used without any licensing restrictions.
89
89
90 The generated wrappers are pre-generated and checked-in for Qt 4.4.3, so you only need to build and run the
90 The generated wrappers are pre-generated and checked-in for Qt 4.6.1, so you only need to build and run the
91 generator when you want to build additional wrappers or you want to upgrade/downgrade to an newer Qt version.
91 generator when you want to build additional wrappers or you want to upgrade/downgrade to another Qt version.
92 You may use the generator to generate C++ bindings for your own C++ classes (e.g. to make them deriveable in Python),
92 You may use the generator to generate C++ bindings for your own C++ classes (e.g., to make them inheritable in Python),
93 , but this is currently not documented and involves creating your own typesystem files.
93 , but this is currently not documented and involves creating your own typesystem files (although the Qt Jambi examples might help you).
94
94
95 \section Features
95 \section Features
96
96
@@ -120,7 +120,7
120 This offers the following features:
120 This offers the following features:
121
121
122 - Complete Qt API wrapped and accessible
122 - Complete Qt API wrapped and accessible
123 - The following modules are available as submodule of the PythonQt module:
123 - The following modules are available as submodules of the PythonQt module:
124 - QtCore
124 - QtCore
125 - QtGui
125 - QtGui
126 - QtNetwork
126 - QtNetwork
@@ -135,20 +135,19
135 - For convenience, all classes are also available in the PythonQt.Qt module, for people who do not care in which module a class is located
135 - For convenience, all classes are also available in the PythonQt.Qt module, for people who do not care in which module a class is located
136 - Any Qt class that has virtual methods can be easily derived from Python and the virtual methods can be reimplemented in Python
136 - Any Qt class that has virtual methods can be easily derived from Python and the virtual methods can be reimplemented in Python
137 - Polymorphic downcasting on QEvent, QGraphicsItem, QStyleOption, ...
137 - Polymorphic downcasting on QEvent, QGraphicsItem, QStyleOption, ...
138 - Multiple inheritance support (e.g. QGraphicsTextItem is a QObject AND a QGraphicsItem, PythonQt will handle this well)
138 - Multiple inheritance support (e.g., QGraphicsTextItem is a QObject AND a QGraphicsItem, PythonQt will handle this well)
139
140 \section Comparision Comparision with PyQt/PySide
139
141
140 \section Comparision Comparision with PyQt
142 - PythonQt is not as Pythonic as PyQt in many details (e.g. buffer protocol, pickling, translation support, ...) and it is mainly thought for embedding and intercommunication between Qt/Cpp and Python
141
143 - PythonQt allows to communicate in both directions, e.g., calling a Python object from C++ AND calling a C++ method from Python, while PyQt only handles the Python->C++ direction
142 - PythonQt is not as Pythonic as PyQt in many details (e.g. operator mapping, pickling, translation support, ...) and it is mainly thought for embedding and intercommunication between Qt/Cpp and Python
143 - PythonQt allows to communicate in both directions, e.g. calling a Python object from C++ AND calling a C++ method from Python, while PyQt only handles the Python->C++ direction
144 - PythonQt offers properties as Python attributes, while PyQt offers them as setter/getter methods (e.g. QWidget.width is a property in PythonQt and a method in PyQt)
144 - PythonQt offers properties as Python attributes, while PyQt offers them as setter/getter methods (e.g. QWidget.width is a property in PythonQt and a method in PyQt)
145 - PythonQt does not support instanceof checks for Qt classes, except for the exact match and derived Python classes
145 - PythonQt does not support instanceof checks for Qt classes, except for the exact match and derived Python classes
146 - QObject.emit to emit Qt signals from Python is not yet implemented but PythonQt allows to just emit a signal by calling it
146 - QObject.emit to emit Qt signals from Python is not yet implemented but PythonQt allows to just emit a signal by calling it
147 - PythonQt does not offer to add new signals to Python/C++ objects
147 - PythonQt does not (yet) offer to add new signals to Python/C++ objects
148 - Ownership of objects is a bit different in PythonQt, currently Python classes derived from a C++ class need to be manually references in PythonQt to not get deleted too early (this will be fixed)
148 - Ownership of objects is a bit different in PythonQt, currently Python classes derived from a C++ class need to be manually referenced in Python to not get deleted too early (this will be fixed)
149 - Probably there are lots of details that differ, I do not know PyQt that well to list them all.
149 - Probably there are lots of details that differ, I do not know PyQt that well to list them all.
150
150
151
152 \section Interface
151 \section Interface
153
152
154 The main interface to PythonQt is the PythonQt singleton.
153 The main interface to PythonQt is the PythonQt singleton.
@@ -390,7 +389,7 yourCpp = None
390
389
391 \section Building
390 \section Building
392
391
393 PythonQt requires at least Qt 4.2.2 (or higher) and Python 2.3, 2.4, 2.5 or 2.6 on Windows, Linux and MacOS X. It has not yet been tested with Python 3.x, but it should only require minor changes.
392 PythonQt requires Qt 4.6.1 (or higher) and Python 2.5 or 2.6 on Windows, Linux and MacOS X. It has not yet been tested with Python 3.x, but it should only require minor changes.
394 To compile PythonQt, you will need a python developer installation which includes Python's header files and
393 To compile PythonQt, you will need a python developer installation which includes Python's header files and
395 the python2x.[lib | dll | so | dynlib].
394 the python2x.[lib | dll | so | dynlib].
396 The build scripts a currently set to use Python 2.5.
395 The build scripts a currently set to use Python 2.5.
General Comments 0
You need to be logged in to leave comments. Login now