You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/PythonQtDoc.h
+26-11
Original file line number
Diff line number
Diff line change
@@ -54,10 +54,10 @@
54
54
\section Introduction
55
55
56
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">
57
+
Python</a> binding for the <a href="http://qt-project.org/" target="_blank">
58
58
Qt framework</a>.
59
59
It offers an easy way to embed the Python scripting language into
60
-
your C++ Qt applications. It makes heavy use of the QMetaObject system and thus requires Qt 4.x.
60
+
your C++ Qt applications.
61
61
62
62
The focus of PythonQt is on embedding Python into an existing C++ application, not on writing the whole
63
63
application completely in Python. If you want to write your whole application in Python,
@@ -78,7 +78,7 @@ Qt framework</a>.
78
78
- \ref Examples
79
79
80
80
\page Features Features
81
-
81
+
82
82
\section Builtin Built-in Features
83
83
84
84
The following are the built-in features of the PythonQt library:
@@ -124,6 +124,17 @@ Qt framework</a>.
124
124
- Polymorphic downcasting on QEvent, QGraphicsItem, QStyleOption, ...
125
125
- Multiple inheritance support (e.g., QGraphicsTextItem is a QObject AND a QGraphicsItem, PythonQt will handle this well)
126
126
127
+
\section Supported Supported Versions
128
+
129
+
PythonQt supports:
130
+
- Python 2 (>= Python 2.6)
131
+
- Python 3 (>= Python 3.3)
132
+
- Qt 4.x (Qt 4.7 and Qt 4.8 recommended)
133
+
- Qt 5.x (Tested with Qt 5.0 and 5.3)
134
+
135
+
The Qt5 support does not yet include Qt modules that have been introduced with Qt5. The new QtWidgets module is wrapped as part of QtGui.
136
+
This allows to run scripts that were written with the Qt4 binding on a Qt5 PythonQt without porting.
137
+
127
138
\section Comparison Comparison with PyQt/PySide
128
139
129
140
- 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
@@ -133,11 +144,9 @@ Qt framework</a>.
133
144
- 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
134
145
- 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)
135
146
- 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)
136
-
- QStrings are always converted to unicode Python objects, QByteArray always stays a QByteArray and can be converted using str()
147
+
- QStrings are always converted to unicode Python objects, QByteArray always stays a QByteArray and can be converted using str() or QByteArray.data()
137
148
- 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.
138
149
- 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).
139
-
- Probably there are lots of details that differ, I do not know PyQt that well to list them all.
140
-
- 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).
141
150
142
151
\page Download Download
143
152
@@ -149,7 +158,7 @@ Qt framework</a>.
149
158
You can also browse the source code online via ViewVC: http://pythonqt.svn.sourceforge.net/viewvc/pythonqt/trunk/
150
159
151
160
\note We do not offer prebuilt binaries, since there are so many possible combinations of
152
-
platforms (Windows/Linux/MacOs), architectures (32/64 bit) and Python versions.
161
+
platforms (Windows/Linux/MacOs), architectures (32/64 bit) and Qt / Python versions.
153
162
154
163
\page License License
155
164
@@ -414,17 +423,18 @@ yourCpp = None
414
423
415
424
\page Building Building
416
425
417
-
PythonQt requires at least Qt 4.6.1 (for earlier Qt versions, you will need to run the pythonqt_gerenator, Qt 4.3 is the absolute minimum) and Python 2.5.x or 2.6.x on Windows, Linux and MacOS X. It has not yet been tested with Python 3.x, but it should only require minor changes.
426
+
PythonQt requires at least Qt 4.6.1 (for earlier Qt versions, you will need to run the pythonqt_generator, Qt 4.3 is the absolute minimum) and Python 2.6.x/2.7.x or Python 3.3 (or higher).
418
427
To compile PythonQt, you will need a python developer installation which includes Python's header files and
419
428
the python2x.[lib | dll | so | dynlib].
429
+
The recommended way to build PythonQt is to use the QMake-based *.pro file.
420
430
The build scripts a currently set to use Python 2.6.
421
431
You may need to tweak the \b build/python.prf file to set the correct Python includes and libs on your system.
422
-
432
+
423
433
\subsection Windows
424
434
425
435
On Windows, the (non-source) Python Windows installer can be used.
426
-
Make sure that you use the same compiler, the current Python distribution is built
427
-
with Visual Studio 2003. If you want to use another compiler, you will need to build
436
+
Make sure that you use the same compiler as the one that your Python distribution is built with.
437
+
If you want to use another compiler, you will need to build
428
438
Python yourself, using your compiler.
429
439
430
440
To build PythonQt, you need to set the environment variable \b PYTHON_PATH to point to the root
@@ -459,6 +469,11 @@ the python2x.[lib | dll | so | dynlib].
459
469
460
470
The tests and examples are located in PythonQt/lib.
461
471
472
+
When using a Python distribution, the debug build typically does not work because the
473
+
pythonxx_d.lib/.dll are not provided. You can tweak linking of the debug build to the release
474
+
Python version, but this typically requires patching pyconfig.h and removing Py_DEBUG and linker pragmas
475
+
(google for it!).
476
+
462
477
\subsection Linux
463
478
464
479
On Linux, you need to install a Python-dev package.
0 commit comments