[PyKDE] PyQt4: PyObject in SIGNAL

Mark Summerfield mark at qtrac.eu
Fri Dec 1 07:47:55 GMT 2006


On Thu 30-Nov-06 18:41, Giovanni Bajo wrote:
> Hello,
>
> what's the meaning of the string "PyObject" used within the signature of a
> signal in PyQt4? I can't seem to find it in the PyQt4 documentation. If I
> pass it a random python object I get core dumps and random crashes, so I
> assume it's not really meant for that...

You can do Python-Python signals which Phil calls "short-circuit
signals" in PyQt (see pyqt4ref.html#pyqt-slots-and-qt-slots section 3.2,
3.4, and 3.5)

For these you do not write parentheses in the signal's signature.
(They don't seem to work across threads; normal Qt signals do though.)

Also, there are some errors in the docs; in section 3.4 the two "SLOT"
lines should be:

QtCore.QObject.connect(a, QtCore.SIGNAL("QtSig()"), b, 
QtCore.SLOT("QtSlot()"))
QtCore.QObject.connect(a, QtCore.SIGNAL("PySig()"), b, 
QtCore.SLOT("QtSlot()"))

-- 
Mark Summerfield, Qtrac Ltd., www.qtrac.eu




More information about the PyQt mailing list