eric6/DebugClients/Python/ThreadExtension.py

branch
maintenance
changeset 7437
1148ca40ea36
parent 7382
df744f939cca
parent 7413
424f88fdee04
child 7642
72721823d453
--- a/eric6/DebugClients/Python/ThreadExtension.py	Mon Feb 03 19:51:20 2020 +0100
+++ b/eric6/DebugClients/Python/ThreadExtension.py	Sat Mar 07 11:11:07 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