##// END OF EJS Templates
improved docs...
florianlink -
r147:83df95056589
parent child
Show More
@@ -53,19 +53,21
53
53
54 \section Introduction
54 \section Introduction
55
55
56 \b PythonQt is a dynamic Python (http://www.python.org) binding for the Qt framework (http://qt.nokia.com).
56 \b PythonQt is a dynamic <a href="http://www.python.org" target="_blank">
57 Python</a> binding for the <a href="http://qt.nokia.com" target="_blank">
58 Qt framework</a>.
57 It offers an easy way to embed the Python scripting language into
59 It offers an easy way to embed the Python scripting language into
58 your C++ Qt applications. It makes heavy use of the QMetaObject system and thus requires Qt 4.x.
60 your C++ Qt applications. It makes heavy use of the QMetaObject system and thus requires Qt 4.x.
59
61
60 The focus of PythonQt is on embedding Python into an existing C++ application, not on writing the whole
62 The focus of PythonQt is on embedding Python into an existing C++ application, not on writing the whole
61 application completely in Python. If you want to write your whole application in Python,
63 application completely in Python. If you want to write your whole application in Python,
62 you should use <a href="http://www.riverbankcomputing.co.uk/pyqt/">PyQt</a> or <a href="http://www.pyside.org">PySide</a> instead.
64 you should use <a href="http://www.riverbankcomputing.co.uk/pyqt/" target="_blank">PyQt</a> or <a href="http://www.pyside.org" target="_blank">PySide</a> instead.
63
65
64 If you are looking for a simple way to embed Python objects into your C++/Qt Application
66 If you are looking for a simple way to embed Python objects into your C++/Qt Application
65 and to script parts of your application via Python, PythonQt is the way to go!
67 and to script parts of your application via Python, PythonQt is the way to go!
66
68
67 PythonQt is a stable library that was developed to make the
69 PythonQt is a stable library that was developed to make the
68 Image Processing and Visualization platform MeVisLab (http://www.mevislab.de)
70 Image Processing and Visualization platform <a href="http://www.mevislab.de" target="_blank">MeVisLab</a>
69 scriptable from Python.
71 scriptable from Python.
70
72
71 \page Features Features
73 \page Features Features
@@ -115,9 +117,24
115 - Polymorphic downcasting on QEvent, QGraphicsItem, QStyleOption, ...
117 - Polymorphic downcasting on QEvent, QGraphicsItem, QStyleOption, ...
116 - Multiple inheritance support (e.g., QGraphicsTextItem is a QObject AND a QGraphicsItem, PythonQt will handle this well)
118 - Multiple inheritance support (e.g., QGraphicsTextItem is a QObject AND a QGraphicsItem, PythonQt will handle this well)
117
119
120 \section Comparison Comparison with PyQt/PySide
121
122 - 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
123 - 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
124 - 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)
125 - PythonQt currently does not support instanceof checks for Qt classes, except for the exact match and derived Python classes
126 - QObject.emit to emit Qt signals from Python is not yet implemented but PythonQt allows to just emit a signal by calling it like a normal slot
127 - PythonQt does not (yet) offer to add new signals to Python/C++ objects and it does not yet support the newstyle PyQt signals (so you need to connect via C++ string signatures)
128 - 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 in a future version)
129 - QStrings are always converted to unicode Python objects, QByteArray always stays a QByteArray and can be converted using str()
130 - There are many details in the generated wrappers that could need some polishing, e.g., methods that use pointer arguments for additional return values could return a results tuple.
131 - Not all types of QList/QVector/QHash templates are supported, some Qt methods use those as arguments/return values (but you can add your own handlers to handle them if you need them).
132 - Probably there are lots of details that differ, I do not know PyQt that well to list them all.
133 - In the long run, PythonQt will consider using/extending PySide with the features of PythonQt to get rid of its own generator and typesystem files, alternatively the KDE Smoke generator might be used in the future (this has not yet been decided, the current PythonQt generator works well and there is no hurry to switch).
134
118 \page Download Download
135 \page Download Download
119
136
120 PythonQt is hosted on SourceForge at http://sourceforge.net/projects/pythonqt.
137 PythonQt is hosted on <a href="http://sourceforge.net/projects/pythonqt/" target="_blank">SourceForge</a>.
121
138
122 You can download the source code as a tarball at http://sourceforge.net/projects/pythonqt/files/.
139 You can download the source code as a tarball at http://sourceforge.net/projects/pythonqt/files/.
123 Alternatively you can get the latest version from the svn repository.
140 Alternatively you can get the latest version from the svn repository.
@@ -146,20 +163,6
146 You may use the generator to generate C++ bindings for your own C++ classes (e.g., to make them inheritable in Python),
163 You may use the generator to generate C++ bindings for your own C++ classes (e.g., to make them inheritable in Python),
147 but this is currently not documented and involves creating your own typesystem files (although the Qt Jambi examples might help you).
164 but this is currently not documented and involves creating your own typesystem files (although the Qt Jambi examples might help you).
148
165
149 \section Comparison Comparison with PyQt/PySide
150
151 - 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
152 - 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
153 - 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)
154 - PythonQt currently does not support instanceof checks for Qt classes, except for the exact match and derived Python classes
155 - QObject.emit to emit Qt signals from Python is not yet implemented but PythonQt allows to just emit a signal by calling it like a normal slot
156 - PythonQt does not (yet) offer to add new signals to Python/C++ objects and it does not yet support the newstyle PyQt signals (so you need to connect via C++ string signatures)
157 - 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 in a future version)
158 - QStrings are always converted to unicode Python objects, QByteArray always stays a QByteArray and can be converted using str()
159 - There are many details in the generated wrappers that could need some polishing, e.g., methods that use pointer arguments for additional return values could return a results tuple.
160 - Not all types of QList/QVector/QHash templates are supported, some Qt methods use those as arguments/return values (but you can add your own handlers to handle them if you need them).
161 - Probably there are lots of details that differ, I do not know PyQt that well to list them all.
162 - In the long run, PythonQt will consider using/extending PySide with the features of PythonQt to get rid of its own generator and typesystem files, alternatively the KDE Smoke generator might be used in the future (this has not yet been decided, the current PythonQt generator works well and there is no hurry to switch).
163
166
164 \page Developer Developer
167 \page Developer Developer
165
168
General Comments 0
You need to be logged in to leave comments. Login now