[Kde-bindings] [Bug 219787] New: krosspython: crash when PyQt signal is connected to C++ method that calls a function in the script
Daniel Calviño Sánchez
danxuliu at gmail.com
Wed Dec 23 06:23:26 UTC 2009
https://bugs.kde.org/show_bug.cgi?id=219787
Summary: krosspython: crash when PyQt signal is connected to
C++ method that calls a function in the script
Product: bindings
Version: unspecified
Platform: Compiled Sources
OS/Version: Linux
Status: NEW
Severity: crash
Priority: NOR
Component: general
AssignedTo: kde-bindings at kde.org
ReportedBy: danxuliu at gmail.com
Version: (using Devel)
Compiler: gcc 4.4.1
OS: Linux
Installed from: Compiled sources
In PyQt, signals can be added to Python objects. Since PyQt 4.5, those signals
are also added to the class's QMetaObject
(http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#defining-new-signals-with-qtcore-pyqtsignal),
so they can be connected even from C++ code.
I have found a crash in a very specific scenario. A signal is defined in a
Python class that inherits from QObject, and an object from that class is
created. There is a C++ method, invokable from the script, that receives a
QObject and the name of a signal. That C++ method does a C++ connect,
connecting the signal in the Python object with a C++ slot. When executed, the
slot calls a function in the script using the Kross Action. I know, it's a
weird scenario, but I use it ;)
So, when the Python signal is emitted, the C++ slot is invoked, and it calls
another Python function. The result is a crash.
In the next comments I'm going to post a unit test showing the problem and a
workaround for it.
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Kde-bindings
mailing list