ThreadExtension: added debugging support for QRunable.

Sat, 15 Feb 2020 12:04:41 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 15 Feb 2020 12:04:41 +0100
changeset 7413
424f88fdee04
parent 7406
f72dfec31dcb
child 7414
d02ed92ef3b2

ThreadExtension: added debugging support for QRunable.

docs/changelog file | annotate | diff | comparison | revisions
eric6/DebugClients/Python/ThreadExtension.py file | annotate | diff | comparison | revisions
diff -r f72dfec31dcb -r 424f88fdee04 docs/changelog
--- a/docs/changelog	Mon Feb 10 18:41:37 2020 +0100
+++ b/docs/changelog	Sat Feb 15 12:04:41 2020 +0100
@@ -2,6 +2,8 @@
 ----------
 Version 20.3:
 - bug fixes
+- Debugger
+  -- added debugging support for QRunable
 - Mercurial Interface
   -- added support for the '--secure' flag of hg import as of Mercurial 5.3
 - Syntax Checker
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