From 57e34b35b9bbf608d19a470ad44e738d56a841bf Mon Sep 17 00:00:00 2001 From: halliday2023 Date: Mon, 12 Feb 2024 22:28:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E6=8C=89=E9=92=AE=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/GUIWindows.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/GUIWindows.py b/bin/GUIWindows.py index d93c3e8..8e6fd27 100644 --- a/bin/GUIWindows.py +++ b/bin/GUIWindows.py @@ -51,7 +51,9 @@ class Window(formType, baseType): self.start_thread() else: self.start_run_db() - + # 按钮置灰 + self.startButton.setEnabled(not self.startButton.isEnabled()) + @Slot() def stop(self): @@ -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')