pyqt signal slot

Now let’s look at the general syntax for connections. We assume that the PyQt
modules have been imported using the from …import * syntax, and that s and
w are QObjects, normally widgets, with s usually being self.
s.connect(w, SIGNAL("signalSignature"), functionName)
s.connect(w, SIGNAL("signalSignature"), instance.methodName)
s.connect(w, SIGNAL("signalSignature"),
instance, SLOT("slotSignature"))
The signalSignature is the name of the signal and a (possibly empty) commaseparated
list of parameter type names in parentheses. If the signal is a Qt signal,
the type names must be the C++ type names, such as int and QString. C++
type names can be rather complex, with each type name possibly including one
or more of const, *, and &. When we write them as signal (or slot) signatures we
can drop any consts and &s, but must keep any *s. For example, almost every
Qt signal that passes a QString uses a parameter type of const QString&, but in
PyQt, just using QString alone is sufficient. On the other hand, the QListWidget
has a signal with the signature itemActivated(QListWidgetItem*), and we must
use this exactly as written.

from rapid pyqt tut 

原文地址:https://www.cnblogs.com/rdRoad/p/1605039.html