带有来自其他模块的发射信号的PYQT5问题
class A(QObject):
def __init__(self):
super(A, self).__init__()
self.work = Worker(self)
self.work.finished.connect(self.ppp)
def ppp(self):
print(6)
我不知道发生了什么事? 我尝试从模块发射信号,然后在B模块中连接函数 但是该功能没有被调用 而且没有出现错误
class Worker(QObject):
# give worker class a finished signal
finished = pyqtSignal()
def __init__(self, parent=None):
QObject.__init__(self, parent=parent)
self.continue_run = True # provide a bool run condition for the class
def send(self):
self.finished.emit()
class A(QObject):
def __init__(self):
super(A, self).__init__()
self.work = Worker(self)
self.work.finished.connect(self.ppp)
def ppp(self):
print(6)
I have no idea what's happening ?
I try to emit the signal from A module then connect function in B module
but the function didn't be called
and there is no error appear
class Worker(QObject):
# give worker class a finished signal
finished = pyqtSignal()
def __init__(self, parent=None):
QObject.__init__(self, parent=parent)
self.continue_run = True # provide a bool run condition for the class
def send(self):
self.finished.emit()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论