这只是我代码的一部分。当我点击btn_convert
或btn_save function
(self.convertThread.start
和self.convert_and_save
)工作时。但是,当我点击btn_convert_save
时,仅使用self.open
。问题是,为什么点击btn_convert_save
后开始不是全部3个功能?
class Window(QtGui.QMainWindow):
def __init__(self):
super(Window, self).__init__() ...
def home(self):
self.saveThread = SaveThread()
self.convertThread = ConvertThread()
btn_convert.clicked.connect(self.convertThread.start)
btn_save.clicked.connect(self.saveThread.start)
btn_convert_save.clicked.connect(self.convert_and_save) ...
def convert_and_save(self):
self.open()
self.convertThread.start
self.saveThread.start
#self.convert()
#self.save_file()
class SaveThread(QtCore.QThread):
def __init__(self):
super(SaveThread, self).__init__()
def run(self):...
class ConvertThread(QtCore.QThread):
def __init__(self):
super(ConvertThread, self).__init__()
def run(self):...
答案 0 :(得分:0)
你忘了括号,而不是
self.convertThread.start
写
self.convertThread.start()