@@ -84,28 +84,44 @@ def accept(self):
8484 worker = AsyncWorker (runner .run_cluster )
8585 runner .thread_pool .start (worker )
8686
87- def on_finished ():
88- # Since this is a QueuedConnection, we need to accept progress here
89- runner .accept_progress ()
90- runner .confirm_indexing_results ()
91-
92- if runner .grains_table is None :
93- # The previous step must have failed. Show again.
94- QTimer .singleShot (0 , self .exec )
95-
96- def on_rejected ():
97- # Since this is a QueuedConnection, we need to accept progress here
98- runner .accept_progress ()
99- self .exec ()
100-
101- worker .signals .result .connect (on_finished , Qt .QueuedConnection )
102- runner .indexing_results_rejected .connect (on_rejected ,
103- Qt .QueuedConnection )
87+ worker .signals .result .connect (
88+ self ._on_run_cluster_finished ,
89+ Qt .QueuedConnection ,
90+ )
91+ runner .indexing_results_rejected .connect (
92+ self ._on_indexing_results_rejected ,
93+ Qt .QueuedConnection ,
94+ )
10495 worker .signals .error .connect (runner .on_async_error )
10596 runner .progress_dialog .exec ()
10697
10798 super ().accept ()
10899
100+ def _on_run_cluster_finished (self ):
101+ # This function was previously a nested function, but for some reason,
102+ # in the latest version of Qt (Qt 6.8.1), a queued connection on a
103+ # nested function no longer seems to work (the application freezes).
104+ # It appears to work, however, if this is a method on the object.
105+ runner = self .indexing_runner
106+
107+ # Since this is a QueuedConnection, we need to accept progress here
108+ runner .accept_progress ()
109+ runner .confirm_indexing_results ()
110+
111+ if runner .grains_table is None :
112+ # The previous step must have failed. Show again.
113+ QTimer .singleShot (0 , self .exec )
114+
115+ def _on_indexing_results_rejected (self ):
116+ # This function was previously a nested function, but for some reason,
117+ # in the latest version of Qt (Qt 6.8.1), a queued connection on a
118+ # nested function no longer seems to work (the application freezes).
119+ # It appears to work, however, if this is a method on the object.
120+
121+ # Since this is a QueuedConnection, we need to accept progress here
122+ self .indexing_runner .accept_progress ()
123+ self .exec ()
124+
109125 def exec (self ):
110126 self .setup_gui ()
111127 self .ui .exec ()
0 commit comments