[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] Bug in PyQt Designer plugin
From:       André <pyqt () andre4all ! de>
Date:       2018-05-01 18:25:31
Message-ID: 5feadd37-35f4-67ba-f1ce-f59e908bc27d () andre4all ! de
[Download RAW message or body]

Hi,
I have a problem when using a threaded third party library in a custom 
widget. Python callbacks which are called from other threads are not 
executed.

Looking at the code of the Designer plugin, python threading is not 
initialized. In the QML Plugin the initialization is correct.

Attached is a patch I tested on my Arch Linux system (PyQt 5.10.1).

André

["pyqt5-designer.patch" (text/x-patch)]

diff -ru a/designer/pluginloader.cpp b/designer/pluginloader.cpp
--- a/designer/pluginloader.cpp	2018-02-27 11:43:53.000000000 +0100
+++ b/designer/pluginloader.cpp	2018-05-01 20:02:24.188429624 +0200
@@ -127,6 +127,11 @@
                 return;
 
             Py_Initialize();
+#if defined(WITH_THREAD)
+            // Make sure we don't have the GIL.
+            PyEval_InitThreads();
+            PyEval_SaveThread();
+#endif
         }
 
         // Import the plugins with the GIL held.

[Attachment #4 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic