eric6/DebugClients/Python/ThreadExtension.py

changeset 7413
424f88fdee04
parent 7364
bcf6b40e7790
child 7415
e953b2a449a9
child 7437
1148ca40ea36
child 7635
0cdead130a81
diff -r f72dfec31dcb -r 424f88fdee04 eric6/DebugClients/Python/ThreadExtension.py
--- a/eric6/DebugClients/Python/ThreadExtension.py	Mon Feb 10 18:41:37 2020 +0100
+++ b/eric6/DebugClients/Python/ThreadExtension.py	Sat Feb 15 12:04:41 2020 +0100
@@ -428,7 +428,23 @@
                     
                     super(QThreadWrapper, self).__init__(*args, **kwargs)
             
+            class QRunnableWrapper(module.QRunnable):
+                """
+                Wrapper class for *.QRunnable.
+                """
+                def __init__(self, *args, **kwargs):
+                    """
+                    Constructor
+                    """
+                    # Overwrite the provided run method with our own, to
+                    # intercept the thread creation by Qt
+                    self.run = lambda s=self, run=self.run: (
+                        _bootstrapQThread(s, run))
+                    
+                    super(QRunnableWrapper, self).__init__(*args, **kwargs)
+            
             module.QThread = QThreadWrapper
+            module.QRunnable = QRunnableWrapper
         
         self.enableImportHooks = True
         return module

eric ide

mercurial