Explorar el Código

引用线程解决 Analyze 和 Elaborate 没有同步打印的问题

mrh hace 3 años
padre
commit
2da10ed7c7
Se han modificado 3 ficheros con 4 adiciones y 6 borrados
  1. 1 0
      main_windows.py
  2. 0 1
      ui/Analyze.py
  3. 3 5
      ui/Elaborate.py

+ 1 - 0
main_windows.py

@@ -139,6 +139,7 @@ class MainWindow(Ui_MainWindow, QMainWindow):
         if type(widget) not in (QTextBrowser, QTextEdit):
             return
         widget.selectAll()
+        
     
     def report_exceptions(self):
         pass

+ 0 - 1
ui/Analyze.py

@@ -106,7 +106,6 @@ class AnalyzeWindow(Ui_AnalyzeWindow, QDialog):
         try:
             thread = threading.Thread(target=self.GUI_shell_execute, args=(f"_GUI.Analyze({args})",))
             thread.start()
-            thread.join()
         except Exception as e:
             print(e)
     

+ 3 - 5
ui/Elaborate.py

@@ -15,8 +15,6 @@ class Elaborate(Ui_Elaborate, QDialog):
     def click_ok(self):
         top = self.top_edit.text()
         bbox = self.checkBox.isChecked()
-        try:
-            self.mainWin.GUI.Elaborate(top,bbox)
-            self.close()
-        except Exception as e:
-            print(e)
+        thread = threading.Thread(target=self.mainWin.GUI.Elaborate, args=(top,bbox,))
+        thread.start()
+        self.close()