Skip to content


Subversion checkout URL

You can clone with
Download ZIP
CMake-ified version of PythonQt

Fix PythonQtSignalReceiver crash during cleanup

This commit fixes a crash during PythonQt::cleanup(). While destroying the
PythonQtPrivate instance, any remaining PythonQtSignalReceivers that are kept
alive only by their parent object will be destroyed. The crash occurs when
PythonQtSignalReceiver's destructor calls back into
PythonQtPrivate::removeSignalEmitter() when the PythonQtPrivate instance is
mostly destroyed.

Includes test case that crashes without the fix.
latest commit cbf890f8ed
@msmolens msmolens authored jcfr committed



PythonQt is a dynamic Python binding for Qt. It offers an easy way to embed the Python scripting language into your Qt applications. It makes heavy use of the QMetaObject system and thus requires Qt4.x.

This project is a fork of the official PythonQt repository hosted on sourceforge.

It serves as staging area to contain patches that will then be contributed back to the official repository.


  • CMake 2.8.x
  • Qt 4.6.2 or above

Build instructions

By default, the patched-5 version will be checked out.

git clone git://
mkdir PythonQt-build
cd PythonQt-build
cmake -DQT_QMAKE_EXECUTABLE:FILEPATH=/path/to/qmake ../PythonQt

Additional configure options are:

  • CMAKE_BUILD_TYPE: Debug, Release, RelWithDebInfo or MinSizeRel
  • PythonQt_DEBUG: Enable/Disable PythonQt debug output
  • PythonQt_Wrap_QtAll: Make all Qt components available in python
  • PythonQt_Wrap_Qt<componentname>: Build PythonQt wrapper associated with <componentname>. Possible <componentname> are gui, network, opengl, sql, uitools, webkit, xml, xmlpatterns.

Available branches

This repository contains 5 branches:


  • Based on patched-4 + r403 excluding commit r397
  • List of bug fixes:
    • Fix for memory leaks and cleanup crash
  • List of features:
    • CMake:
    • Fix install rules
    • Fix "_invalid_parameter_noinfo_noreturn" link error
    • PythonQt:
    • Add Qt5 support
    • Add PY3K support


  • Based on patched-3 + r245
  • List of features:
    • Add BUILD_TESTING option disabled by default to keep behavior consistent with previous version.
    • Do not exclude enums from wrapping if they are QFlags.
    • Ensure enums added using only Q_FLAGS without corresponding Q_ENUMS are wrapped.



  • Based on r228
  • List of features:
    • At configuration time, detect the Qt version used and seamlessly compile the appropriate wrappers (Qt 4.8, 4.7 or 4.6).
    • Add method allowing to know if a python error occurred: 5935f29
    • Also add associated method "resetErrorFlag": a386dc60
    • Fix compilation issue on VS2010 when PythonQt Debug build against python Release: 7e1e07f
    • Add option Add PythonQt_Wrap_QtAll: 97df3b0 and 9104fa9
    • Ensure all 4.8 generated wrappers are considered: 654f324
    • Update "PythonQtPythonInclude.h" to avoid build error on recent MacOSX: 7b8ee130 and 47738f9c
    • Update "PythonQtPythonInclude.h" to fix windows build issue when PythonQt Debug build against python Release6366f00
    • Optionally include CTestUseLaunchers: 211440
    • Add SystemExit exception handler. If enabled, the signal "systemExitExceptionRaised" will be emitted. It gives application the opportunity to cleanup and terminate nicely: 3c84463d
    • Add "isatty" function to StdOutRedirect. Needed by some logging frame: 7132dba9
  • Backported:


  • Based on r193
  • List of features:
    • CMake'ified PythonQt project
    • CMake'ified PythonQt/generator project
    • Add dPython.h file, it provides the ability to link against release python with a debug build of your project.
    • Option PYTHONQT_USE_VTK CMake option allowing to teach PythonQt how to deal with vtkObject
    • Stdin can optionally be redirected to a custom callback
    • More details


  • SVN history imported using git-svn


Once you've made your great commits:

  1. Fork PythonQt
  2. Create a topic branch - git checkout -b my_branch
  3. Push to your branch - git push origin my_branch
  4. Create an Issue with a link to your branch
  5. That's it!



Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Something went wrong with that request. Please try again.