eric6/DebugClients/Python/ThreadExtension.py

branch
multi_processing
changeset 7415
e953b2a449a9
parent 7412
0a995393d2ba
parent 7413
424f88fdee04
child 7416
6f899e82f9a2
--- a/eric6/DebugClients/Python/ThreadExtension.py	Fri Feb 14 19:52:37 2020 +0100
+++ b/eric6/DebugClients/Python/ThreadExtension.py	Sat Feb 15 12:13:52 2020 +0100
@@ -406,9 +406,26 @@
                 
                 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
-    
-    # TODO: add support for QRunnable
+        module.QRunnable = QRunnableWrapper
+        
+        self.enableImportHooks = True
+        return module
 
 #
 # eflag: noqa = M702

eric ide

mercurial