Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2024-07-02 12:51:44 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2024-07-04 11:55:43 +0200
commit225e18558f37e2b228be5da60f27ec8186a26bc7 (patch)
treee2ea024166fa46d65555a77f50206024d03579c8 /sources/pyside6/libpyside/qobjectconnect.cpp
parent803d173fd9ca70c19cb254a2c53f67500fc7ebea (diff)
libpyside: Fix QObject.connectNotify()
QObject::connectNotify() is meant to be called with the signal method. The code retrieved the signal method from the receiver though, potentially causing an index violation. Fix it to use the source. Remove misleading comments from 4edd9a1278efdf37f366e9aa6e82f151a357ef32. Change-Id: Id5afdde16ce002e156710128e9610804b748be74 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6/libpyside/qobjectconnect.cpp')
-rw-r--r--sources/pyside6/libpyside/qobjectconnect.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/sources/pyside6/libpyside/qobjectconnect.cpp b/sources/pyside6/libpyside/qobjectconnect.cpp
index 1d9453ab1..d0a1a2c50 100644
--- a/sources/pyside6/libpyside/qobjectconnect.cpp
+++ b/sources/pyside6/libpyside/qobjectconnect.cpp
@@ -258,7 +258,7 @@ QMetaObject::Connection qobjectConnectCallback(QObject *source, const char *sign
if (receiver.usingGlobalReceiver)
signalManager.notifyGlobalReceiver(receiver.receiver);
- const QMetaMethod signalMethod = receiver.receiver->metaObject()->method(signalIndex);
+ const QMetaMethod signalMethod = source->metaObject()->method(signalIndex);
static_cast<FriendlyQObject *>(source)->connectNotify(signalMethod);
return connection;
}
@@ -298,7 +298,7 @@ QMetaObject::Connection qobjectConnectCallback(QObject *source, const char *sign
if (receiver.usingGlobalReceiver)
signalManager.notifyGlobalReceiver(receiver.receiver);
- const QMetaMethod signalMethod = receiver.receiver->metaObject()->method(signalIndex);
+ const QMetaMethod signalMethod = source->metaObject()->method(signalIndex);
static_cast<FriendlyQObject *>(source)->connectNotify(signalMethod);
return connection;
}