Python Bindings for Qt (3.7)

Phil Thompson

This document describes a set of Python bindings for the Qt widget set. Contact the author at .


Introduction

PyQt is a set of Python bindings for the Qt toolkit and available for all platforms supported by Qt, including Windows, Linux, UNIX and embedded systems such as the Sharp Zaurus and the Compaq iPAQ. They have been tested against Qt versions 1.43 to 3.1.2, Qt Non-commercial, Qtopia 1.5.0, and Python versions 1.5 to 2.3b2.

PyQt is available under the GPL license for use with the GPL version of Qt, a a commercial license for use with the commercial version of Qt, and an educational license for use with the educational version of Qt.

The bindings are implemented as a number of Python modules

PyQt also includes the pyuic and pylupdate utilities which correspond to the Qt uic and lupdate utilities. pyuic converts the GUI designs created with Qt Designer to executable Python code. pylupdate scans Python code, extracts all strings that are candidates for internationalisation, and creates an XML file for use by Qt Linguist.

Changes

The changes visible to the Python programmer in this release are as follows.

  • SIP 3.7 is required. Starting with SIP 3.1 the run-time support library is implemented as a Python module and so is installed in a different place to earlier versions. You should manually remove any versions of the SIP run-time support library and header files earlier than 3.1.

  • dir() of a PyQt class now returns all attributes of the class (rather than just the "non-lazy" attributes).

  • The QSignalMapper and QWindowsXPStyle (Windows XP only) classes have been added to the qt module.

  • The QextScintillaLexerHTML and QextScintillaLexerSQL classes have been added to the qtext module.

  • The __add__(), __iadd__(), __mul__(), __imul__(), __eq__(), __ne__(), __setitem__() and __delitem__() operators have been added to the QStringList class.

  • The bits(), colorTable(), jumpTable() and scanLine() methods have been added to the QImage class.

  • The toDouble(), toFloat(), toInt(), toLong(), toShort(), toUInt(), toULong() and toUShort() methods have been added to the QCString and QString classes.

  • The modificationAttempted() signal has been added to the QextScintilla class.

  • pyuic for Qt v3 now supports a -test command line flag which generates code that will run to completion without displaying the form or needing interaction with the user.

  • Several new example scripts have been added (thanks to Jorge Arroyo).