[PyQt] New Feature - Keyword Arguments for Properties and Signals

Phil Thompson phil at riverbankcomputing.com
Mon Sep 7 08:57:42 BST 2009

The current SIP and PyQt snapshots support the use of using keyword
arguments when creating an instance of a QObject sub-class to initialise Qt
properties and to connect signals.

For example, the following calls...

    act = QAction("Save", parent)
    act.setStatusTip("Save the document")

...can be replaced by...

    act = QAction("Save", parent, shortcut=QKeySequence.Save,
            statusTip="Save the document", triggered=self.save)

This will automatically work for any Qt property and signal (eg. in KDE
classes) without needing to change any .sip files.


More information about the PyQt mailing list