[PyQt] simpler 'connect' function

Henrik Pauli henrik.pauli at gmail.com
Thu Jan 10 17:39:58 GMT 2008

I'm not sure how accepted that approach is, but I personally really
didn't like having to say QtGui and QtCore all the time, so I "from
... import *"-ed those.  This makes a connect a couple words shorter
and a lot less hideous.

On Jan 10, 2008 6:26 PM, Peter Shinners <pshinners at blizzard.com> wrote:
> I'm sure this has come up, but as I write my Pyqt code, I keep noticing
> that the QObject.connect call feels like a wart. Is there already a pyqt
> shortcut for a call like this?
>     QtCore.QObject.connect(myButton, QtCore.SIGNAL("clicked()"),
> onClicked)
> The closer I could be to something like the following, the better.
>     myButton.connect("clicked()", onClicked)
> Are there any shortcuts for wiring signals and slots I haven't noticed?
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

More information about the PyQt mailing list