Python Bindings for Qt (v2.5)

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. The bindings are implemented as a single Python module qt. A separate Python module qtgl implements OpenGL support. They have been tested against Qt versions 1.42 to 2.3.1, Qt Non-commercial and Python versions 1.5 to 2.1.1.

PyQt also includes the pyuic PyQt code generator used as a backend for the Qt Designer GUI design tool.

Finally, PyQt also includes a debugger called eric.

Changes

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

  • Added the qtgl module which includes the QGL, QGLContext, QGLFormat and QGLWidget classes, and the gears.py example script.

  • The QInterlaceStyle is disabled if building against Qt v2.3.0.

  • The following classes have been added: Display, QDataStream, QDomAttr, QDomCDATASection, QDomCharacterData, QDomComment, QDomDocument, QDomDocumentFragment, QDomDocumentType, QDomElement, QDomEntity, QDomEntityReference, QDomImplementation, QDomNamedNodeMap, QDomNode, QDomNodeList, QDomNotation, QDomProcessingInstruction, QDomText and QTranslatorMessage.

  • NULL instances of QCanvasItemList, QFileInfoList, QObjectList, QStrList and QWidgetList are now converted to an empty Python list rather than None.

  • The Custom value was added to QPrinter.PageSize. (Qt v2.3.1)

  • The following missing methods have been added: QColor.getHsv(), QInputDialog.getText(), QPaintDevice.x11AppDisplay(), QPaintDevice.x11Display(), QPaintDevice.x11SetAppDpiX(), QPaintDevice.x11SetAppDpiY(), QPixmap.save(), QTranslator.contains(), QTranslator.find(), QTranslator.findMessage(), QTranslator.insert(), QTranslator.remove(), QTranslator.squeeze(), QWidget.customEvent() and QWidget.reparent().

  • The following missing functions have been added: qt_xdisplay(), qt_xscreen() and qt_xrootwin().

  • A long standing problem where PyQt was unable to distinguish between overloaded methods with similar signatures (eg. QWMatrix.map(int,int) and QWMatrix.map(double,double)) has been resolved. This affects the following methods: QCString.setNum(), QLabel.setNum(), QLCDNumber.checkOverflow(), QString.arg(), QString.number(), QString.setNum(), QVariant() and QWMatrix.map().