@@ -66,31 +66,12 | |||||
66 | Image Processing and Visualization platform MeVisLab (http://www.mevislab.de) |
|
66 | Image Processing and Visualization platform MeVisLab (http://www.mevislab.de) | |
67 | scriptable from Python. |
|
67 | scriptable from Python. | |
68 |
|
68 | |||
|
69 | ||||
69 | \section Download |
|
70 | \section Download | |
70 |
|
71 | |||
71 | PythonQt is hosted on SourceForge at http://sourceforge.net/projects/pythonqt , you can access it via SVN |
|
72 | PythonQt is hosted on SourceForge at http://sourceforge.net/projects/pythonqt , you can access it via SVN | |
72 | or download a tarball. |
|
73 | or download a tarball. | |
73 |
|
74 | |||
74 | \section Licensing |
|
|||
75 |
|
||||
76 | PythonQt is distributed under the LGPL license, so it pairs well with the LGPL of the Qt 4.5 release and allows |
|
|||
77 | to be used in commercial applications when following the LGPL 2.1 obligations. |
|
|||
78 |
|
||||
79 | \section LicensingWrapper Licensing of Wrapper Generator |
|
|||
80 |
|
||||
81 | The build system of PythonQt makes use of a modified version of the LGPL'ed QtScript generator, |
|
|||
82 | located in the "generator" directory. |
|
|||
83 |
|
||||
84 | See http://qt.gitorious.org/qt-labs/qtscriptgenerator for details on the original project. |
|
|||
85 | Thanks a lot to the QtJambi guys and the QtScript Generator project for the C++ parser and |
|
|||
86 | Qt typesystem files! |
|
|||
87 |
|
||||
88 | The PythonQt wrappers generated by the generator located in the "generated_cpp" directory are free to be used without any licensing restrictions. |
|
|||
89 |
|
||||
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 another Qt version. |
|
|||
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 (although the Qt Jambi examples might help you). |
|
|||
94 |
|
75 | |||
95 | \section Features |
|
76 | \section Features | |
96 |
|
77 | |||
@@ -136,8 +117,29 | |||||
136 | - Any Qt class that has virtual methods can be easily derived from Python and the virtual methods can be reimplemented in Python (this feature is considered experimental!) |
|
117 | - Any Qt class that has virtual methods can be easily derived from Python and the virtual methods can be reimplemented in Python (this feature is considered experimental!) | |
137 | - Polymorphic downcasting on QEvent, QGraphicsItem, QStyleOption, ... |
|
118 | - Polymorphic downcasting on QEvent, QGraphicsItem, QStyleOption, ... | |
138 | - Multiple inheritance support (e.g., QGraphicsTextItem is a QObject AND a QGraphicsItem, PythonQt will handle this well) |
|
119 | - Multiple inheritance support (e.g., QGraphicsTextItem is a QObject AND a QGraphicsItem, PythonQt will handle this well) | |
|
120 | ||||
139 |
|
121 | |||
140 | \section Comparision Comparision with PyQt/PySide |
|
122 | \section Licensing | |
|
123 | ||||
|
124 | PythonQt is distributed under the LGPL license, so it pairs well with the LGPL of the Qt 4.5 release and allows | |||
|
125 | to be used in commercial applications when following the LGPL 2.1 obligations. | |||
|
126 | ||||
|
127 | The build system of PythonQt makes use of a modified version of the LGPL'ed QtScript generator, | |||
|
128 | located in the "generator" directory. | |||
|
129 | ||||
|
130 | See http://qt.gitorious.org/qt-labs/qtscriptgenerator for details on the original project. | |||
|
131 | Thanks a lot to the QtJambi guys and the QtScript Generator project for the C++ parser and | |||
|
132 | Qt typesystem files! | |||
|
133 | ||||
|
134 | The PythonQt wrappers generated by the generator located in the "generated_cpp" directory are free to be used without any licensing restrictions. | |||
|
135 | ||||
|
136 | The generated wrappers are pre-generated and checked-in for Qt 4.6.1, so you only need to build and run the | |||
|
137 | generator when you want to build additional wrappers or you want to upgrade/downgrade to another Qt version. | |||
|
138 | You may use the generator to generate C++ bindings for your own C++ classes (e.g., to make them inheritable in Python), | |||
|
139 | but this is currently not documented and involves creating your own typesystem files (although the Qt Jambi examples might help you). | |||
|
140 | ||||
|
141 | ||||
|
142 | \section Comparison Comparison with PyQt/PySide | |||
141 |
|
143 | |||
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 |
|
144 | - 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 | |
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 |
|
145 | - 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 | |
@@ -173,7 +175,7 | |||||
173 | <tr><td>long</td><td>integer</td></tr> |
|
175 | <tr><td>long</td><td>integer</td></tr> | |
174 | <tr><td>ulong,longlong,ulonglong</td><td>long</td></tr> |
|
176 | <tr><td>ulong,longlong,ulonglong</td><td>long</td></tr> | |
175 | <tr><td>QString</td><td>unicode string</td></tr> |
|
177 | <tr><td>QString</td><td>unicode string</td></tr> | |
176 |
<tr><td>QByteArray</td><td> |
|
178 | <tr><td>QByteArray</td><td>QByteArray wrapper</td></tr> | |
177 | <tr><td>char*</td><td>str</td></tr> |
|
179 | <tr><td>char*</td><td>str</td></tr> | |
178 | <tr><td>QStringList</td><td>tuple of unicode strings</td></tr> |
|
180 | <tr><td>QStringList</td><td>tuple of unicode strings</td></tr> | |
179 | <tr><td>QVariantList</td><td>tuple of objects</td></tr> |
|
181 | <tr><td>QVariantList</td><td>tuple of objects</td></tr> | |
@@ -182,17 +184,17 | |||||
182 | <tr><td>QSize, QRect and all other standard Qt QVariants</td><td>variant wrapper that supports complete API of the respective Qt classes</td></tr> |
|
184 | <tr><td>QSize, QRect and all other standard Qt QVariants</td><td>variant wrapper that supports complete API of the respective Qt classes</td></tr> | |
183 | <tr><td>OwnRegisteredMetaType</td><td>C++ wrapper, optionally with additional information/wrapping provided by registerCPPClass()</td></tr> |
|
185 | <tr><td>OwnRegisteredMetaType</td><td>C++ wrapper, optionally with additional information/wrapping provided by registerCPPClass()</td></tr> | |
184 | <tr><td>QList<AnyObject*></td><td>converts to a list of CPP wrappers</td></tr> |
|
186 | <tr><td>QList<AnyObject*></td><td>converts to a list of CPP wrappers</td></tr> | |
185 | <tr><td>EnumType</td><td>integer (all enums that are known via the moc and the Qt namespace are supported)</td></tr> |
|
187 | <tr><td>QVector<AnyObject*></td><td>converts to a list of CPP wrappers</td></tr> | |
|
188 | <tr><td>EnumType</td><td>Enum wrapper derived from python integer</td></tr> | |||
186 | <tr><td>QObject (and derived classes)</td><td>QObject wrapper</td></tr> |
|
189 | <tr><td>QObject (and derived classes)</td><td>QObject wrapper</td></tr> | |
187 | <tr><td>C++ object</td><td>CPP wrapper, either wrapped via PythonQtCppWrapperFactory or just decorated with decorators</td></tr> |
|
190 | <tr><td>C++ object</td><td>CPP wrapper, either wrapped via PythonQtCppWrapperFactory or just decorated with decorators</td></tr> | |
188 | <tr><td>PyObject</td><td>PyObject</td></tr> |
|
191 | <tr><td>PyObject</td><td>PyObject</td></tr> | |
189 | </table> |
|
192 | </table> | |
190 |
|
193 | |||
191 |
PyObject is passed as |
|
194 | PyObject is passed as direct pointer, which allows to pass/return any Python object directly to/from | |
192 | a Qt slot. |
|
195 | a Qt slot that uses PyObject* as its argument/return value. | |
193 | QVariants are mapped recursively as given above, e.g. a dictionary can |
|
196 | QVariants are mapped recursively as given above, e.g. a dictionary can | |
194 | contain lists of dictionaries of doubles. |
|
197 | contain lists of dictionaries of doubles. | |
195 | For example a QVariant of type "String" is mapped to a python unicode string. |
|
|||
196 | All Qt QVariant types are implemented, PythonQt supports the complete Qt API for these object. |
|
198 | All Qt QVariant types are implemented, PythonQt supports the complete Qt API for these object. | |
197 |
|
199 | |||
198 | \section QObject QObject Wrapping |
|
200 | \section QObject QObject Wrapping | |
@@ -413,15 +415,15 the python2x.[lib | dll | so | dynlib]. | |||||
413 | When using the prebuild Python installer, this will be: |
|
415 | When using the prebuild Python installer, this will be: | |
414 |
|
416 | |||
415 | \code |
|
417 | \code | |
416 |
> set PYTHON_PATH = c:\Python2 |
|
418 | > set PYTHON_PATH = c:\Python26 | |
417 |
> set PYTHON_LIB = c:\Python2 |
|
419 | > set PYTHON_LIB = c:\Python26\libs | |
418 | \endcode |
|
420 | \endcode | |
419 |
|
421 | |||
420 | When using the python sources, this will be something like: |
|
422 | When using the python sources, this will be something like: | |
421 |
|
423 | |||
422 | \code |
|
424 | \code | |
423 |
> set PYTHON_PATH = c:\yourDir\Python-2. |
|
425 | > set PYTHON_PATH = c:\yourDir\Python-2.6.1\ | |
424 |
> set PYTHON_LIB = c:\yourDir\Python-2. |
|
426 | > set PYTHON_LIB = c:\yourDir\Python-2.6.1\PCbuild8\Win32 | |
425 | \endcode |
|
427 | \endcode | |
426 |
|
428 | |||
427 | To build all, do the following (after setting the above variables): |
|
429 | To build all, do the following (after setting the above variables): |
General Comments 0
You need to be logged in to leave comments.
Login now