控制按钮状态
This commit is contained in:
parent
e78d291936
commit
57e34b35b9
|
@ -51,6 +51,8 @@ class Window(formType, baseType):
|
|||
self.start_thread()
|
||||
else:
|
||||
self.start_run_db()
|
||||
# 按钮置灰
|
||||
self.startButton.setEnabled(not self.startButton.isEnabled())
|
||||
|
||||
|
||||
@Slot()
|
||||
|
@ -61,6 +63,8 @@ class Window(formType, baseType):
|
|||
self.stop_run_file()
|
||||
else:
|
||||
self.stop_run_db()
|
||||
# 按钮恢复
|
||||
self.startButton.setEnabled(not self.startButton.isEnabled())
|
||||
|
||||
@Slot()
|
||||
def conntest(self):
|
||||
|
@ -104,9 +108,11 @@ class Window(formType, baseType):
|
|||
|
||||
|
||||
def stop_run_file(self):
|
||||
# 终止线程的事件循环
|
||||
global_var.set_value('start_flag',False)
|
||||
self.thread.quit() # 终止线程的事件循环
|
||||
self.thread_running = False # 标记线程停止
|
||||
self.thread.quit()
|
||||
# 标记线程停止
|
||||
self.thread_running = global_var.get_value('start_flag')
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue