文件1:
class A(QObject):
status = Signal()
.
.
def func1(self, boolean_var):
self.emit.status()
文件2:
class B(QMainWindow):
.
.
self.model.status.connect(self.update)
@Slot()
def update(self):
# here i have to process data based on the boolean argument passed through signal
我在这里使用了signal()而没有参数,但是我怎么能在这里添加一个参数呢?
答案 0 :(得分:2)
from PySide import QtCore
class A(QtCore.QObject):
status = QtCore.Signal(bool)
def func1(self, *args):
self.status.emit(*args)
# later...
@QtCore.Slot(bool)
def update(self, bool_args):
pass # insert what you need to do here.