0

我试图在从线程调用的函数中显示 pyside python 中的消息框,但我收到错误“致命 IO 错误:客户端被杀死”并且如果我在没有线程的情况下正常调用函数,窗体会在正确显示时关闭

定义线程时按钮单击的代码

mythread = Thread(target=self.main_campaign)
mythread.start()

功能如下

def main_campaign(self):
    QMessageBox.question(self, 'title', 'text', QMessageBox.Yes | QMessageBox.No)
4

0 回答 0