This project is NOT the official PythonQt repository.
It is a fork of PythonQt sources hosted on sourceforge adding support for CMake build system.
It is used as staging area to maintain and test patches that will be contributed back to the official repository.
PythonQt is a dynamic Python binding for Qt. It offers an easy way to embed the Python scripting language into your Qt applications.
Based on the Qt version your project is expected to support, you could use one of the branch referenced below:
| Supported Qt version | 4 | 5 |
|---|---|---|
| Branch | patched-6 | patched-9 |
| Base PythonQt revision | r403 | MeVisLab/pythonqt@c07f09fd |
-
Install CMake and Qt
-
Checkout sources
git clone git://github.com/commontk/PythonQt.git
- Checkout branch
git checkout -b patched-X origin/patched-X
See table above for exact branch name
- Configure
mkdir PythonQt-build && cd PythonQt-build
- using Qt4:
cmake -DQT_QMAKE_EXECUTABLE:FILEPATH=/path/to/qmake ../PythonQt
- using Qt5:
cmake -DQt5_DIR:PATH=/path/to/Qt5.X.Y/X.Y/compiler/lib/cmake/Qt5 ../PythonQt
- Build
make
Additional configure options are:
CMAKE_BUILD_TYPE: Debug, Release, RelWithDebInfo or MinSizeRelPythonQt_DEBUG: Enable/Disable PythonQt debug outputPythonQt_Wrap_QtAll: Make all Qt components available in pythonPythonQt_Wrap_Qt<componentname>: Build a specific PythonQt wrapper.
This repository contains 9 branches:
- Based on MeVisLab/pythonqt@c07f09fd with:
- all changes from
patched-8cherry-picked expect:Fix refcount problems seen when re-initializing Python after finalizingalready integrated as MeVisLab/pythonqt@5e0d26c01ff (fixed ref counting of types)Explicitly initialize global storage containersalready integrated as MeVisLab/pythonqt@170d4a475 (reimplemented argument frame caching (previous approach was not thread-safe when GIL is used))Expose QSocketNotifier for Qt5already integrated as MeVisLab/pythonqt@518765494d (updated wrappers to contain QSocketNotifier and recent generator changes)
- Add support for building 511 wrappers
- Add support for QtMultimedia component
- cmake: Add missing source file
- all changes from
- Based on r455 with:
- revert of r444
- all changes from
patched-7cherry-picked. - add support for build wrapping for Qml and Quick components
- improve Qt5 support and remove Qt4 support
- Remove explicit setup of
INSTALL_NAME_DIR. See PR #59 - add patch from @pieper fixing wrapping of
QSocketNotifier(see PR#63 and message on PythonQt mailinglist) - Fix windows build error renaming stdout ivar
- Add support for enabling stdout/stderr redirection
- Fix setRedirectStdInCallbackEnabled
- Based on r443 with:
- partial revert of r431 to re-enable CMake support
- all changes from
patched-6cherry-picked. - add Qt5 support
- Remove explicit setup of
INSTALL_NAME_DIR. Backported PR #59 - Based on patched-5 + r403
- List of bug fixes:
- Fix for memory leaks and cleanup crash
- Includes the following PythonQt updates:
$ git shortlog 2d445d5..e93e36b --no-merges
florianlink (8):
fixed error handling for evalFile made name->objectName alias optional (off by default, add PYTHONQT_SUPPORT_NAME_PROPERTY to DEFINES if you need it) added py_delete() slot support for built-in delete() method
added support for QTimer::singleShot()
fixed a missign QMetaObject::disconnect which leads to connection leaking added removeSignalHandlers()
fixed test
initial version that handles qualified virtual calls better
improved handling of qualified virtual calls
improved handling of qualified virtual calls
removed generating wrappers for virtual functions that are already declared in a base class