View Full Version : PythonQt 1.0

9th May 2007, 09:49
I would like to announce the PythonQt 1.0 release,
a dynamic and lightweight script binding of the Qt4
framework to the Python language.
It is very easy to embedd into existing Qt applications.

PythonQt is released under the LGPL license, so it can be used both in commercial and open source projects.

Details on the 1.0 release can be found at:


In contrast to PyQt (http://www.riverbankcomputing.co.uk/pyqt/), PythonQt is NOT a complete wrapper of the complete Qt API, but instead offers a very dynamic way to script QObjects and manually wrapped C++ classes inside of your Qt4 applications.

So you can best compare PythonQt with QtScript, which has been published with the Qt 4.3 RC1, but instead of JavaScript, the embedded script language is Python.

A short feature overview of the 1.0 release:

- Access all slots, properties, children and registered enums of any QObject derived class from Python
- Connecting Qt Signals to Python functions (both from within Python and from C++)
- Wrapping of C++ objects (which are not derived from QObject) via PythonQtCPPWrapperFactory
- Extending C++ and QObject derived classes with additional slots, static methods and constructors (see Decorators)
- StdOut/Err redirection to Qt signals instead of cout
- Support for ALL built-in Qt QVariant types (with complete API mapped to Python)
- Support for custom MetaTypes in QVariants
- Easy way to wrap non-slot methods of existing QObject derived classes with "decorator slots"
- Complete Qt GUI Constructors/Destructors support via QUILoader
- Support for CPP Constructors and easy manual wrapping of CPP API
- Complete support for Enum types
- Support for Qt namespace and Enums
- Support for loading python scripts from Qt resources (see examples)
- Auto-completion on the PyScriptConsole, which is now part of PythonQt core library
- support for dir() statement on all wrapped objects
- new help() method that prints details on wrapped objects

12th May 2007, 19:42
Bravo! Yet another reason for me to learn Python! :-)

16th May 2007, 12:22
Very nice !

So if I understand well, PythonQt can be used to replace Qsa ?

How easy can it be embedded in an application in comparaison to Qsa ?

16th May 2007, 17:03
How does PythonQt compare to using Boost.Python to embed Python in a Qt application?

31st May 2007, 19:52
Yes, PythonQt can "replace" QSA, or coexist in the same application.
The integration of PythonQt is as easy as integrating QSA, the biggest difference is that you need to add the Python binary and the Python/Libs to your application in addition to PythonQt,
while QSA is self-contained.

PythonQt is completly dynamic, while Boost.Python requires to generate wrapper
objects for every object that you want to access. PythonQt makes use of the QMetaObject system to allow dynamic signal/slot/property access.

3rd June 2007, 11:52
I'm very interested in this project. What about an equivalent for QSEditor and maybe QSWorkbench ?

The svn version does not compile. I can send a patch but it should be really easy to fix.

3rd July 2007, 10:35
Please send the patch to florian (at) mevis.de, I did not recognize that it
does not compile because I work on a different svn branch in my company.

I started implementing an own TextEditor with
- Python syntax highlighting
- Autocompletion for builtins, keywords and types in an attached python module
- Autocompletion for import
- Autoindent/dedent after ident/dedend keywords
- Brace matching
- Outline which shows classes and functions in the loaded file

It will first be incorportated in our product MeVisLab and I hope I find some time to create a standalone version for PythonQt.