[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyQt] Signal causes seg fault
From: Phil Thompson <phil () riverbankcomputing ! com>
Date: 2017-02-16 16:57:45
Message-ID: 3C2412C1-B827-432D-8AE5-EFA093C45071 () riverbankcomputing ! com
[Download RAW message or body]
On 15 Feb 2017, at 9:55 pm, Cody Scott <cody@perspexis.com> wrote:
>
> The segfault is gone! \o/
>
> I'm trying to bind to a pyqtProperty from the parent class but emitting the correct \
> signal does not update the view.
> https://gist.github.com/Siecje/4a99c2c76f65f39a57c168da10407e7f
>
> If there is no child class then it works.
Should be fixed in tonight's snapshot. Attached is the patch.
Thanks,
Phil
["qmlfix.diff" (qmlfix.diff)]
diff -r f12c11450b7f qpy/QtQml/qpyqmlobject.cpp
--- a/qpy/QtQml/qpyqmlobject.cpp Wed Feb 15 10:25:45 2017 +0000
+++ b/qpy/QtQml/qpyqmlobject.cpp Thu Feb 16 16:52:48 2017 +0000
@@ -96,6 +96,13 @@
// Note that we used to use sender() but this proved unreliable.
if (call == QMetaObject::InvokeMetaMethod && \
proxied_mo->method(idx).methodType() == QMetaMethod::Signal) {
+ // Get the meta-object of the class that defines the signal.
+ while (idx < proxied_mo->methodOffset())
+ {
+ proxied_mo = proxied_mo->superClass();
+ Q_ASSERT(proxied_mo);
+ }
+
// Relay the signal to QML.
QMetaObject::activate(this, proxied_mo,
idx - proxied_mo->methodOffset(), args);
[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