CMake-ified version of PythonQt
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
COPYING Add README and LICENSE Aug 8, 2017
README.md Update README.md Feb 4, 2018

README.md

PythonQt

Why is this project ?

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.

What is PythonQt ?

PythonQt is a dynamic Python binding for Qt. It offers an easy way to embed the Python scripting language into your Qt applications.

Which branch ?

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-8
Base PythonQt revision r403 r455

Build instructions

  1. Install CMake and Qt

  2. Checkout sources

git clone git://github.com/commontk/PythonQt.git
  1. Checkout branch
git checkout -b patched-X origin/patched-X

See table above for exact branch name

  1. 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
  1. Build
make

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 a specific PythonQt wrapper.

Available branches

This repository contains 8 branches:

patched-8

  • Remove explicit setup of INSTALL_NAME_DIR. See PR #59
  • Based on r455 with:
    • revert of r444
    • all changes from patched-7 cherry-picked.
    • add support for build wrapping for Qml and Quick components
    • improve Qt5 support and remove Qt4 support
    • add patch from @pieper fixing wrapping of QSocketNotifier (see PR#63 and message on PythonQt mailinglist)

patched-7

  • Based on r443 with:
    • partial revert of r431 to re-enable CMake support
    • all changes from patched-6 cherry-picked.
    • add Qt5 support

patched-6

  • 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

patched-5

  • 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

patched-4

  • 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.

patched-3

patched-2

  • 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:

patched

  • 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-mirror

  • SVN history imported using git-svn

Contributing

Once you've made your great commits:

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

License

PythonQt is licensed under the GNU Lesser General Public License.