diff options
| author | Joni Poikelin <joni.poikelin@qt.io> | 2021-03-30 12:48:11 +0300 |
|---|---|---|
| committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2021-10-13 12:37:19 +0200 |
| commit | a194a3cf30f024659d3e2223ef7a9fd82319cbb6 (patch) | |
| tree | a729f04284e0f6a2bb35e02e6f958b31d2f69855 /src/remoteobjects/qremoteobjectsource.cpp | |
| parent | b936726d56f33176349ff52ab20306ffc91efac3 (diff) | |
Fix header change replication
Fixes: QTBUG-91041
Pick-to: 6.2 5.15
Change-Id: I5b56ed81ee9df658e0c596199dfde067bba6cd43
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'src/remoteobjects/qremoteobjectsource.cpp')
| -rw-r--r-- | src/remoteobjects/qremoteobjectsource.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/remoteobjects/qremoteobjectsource.cpp b/src/remoteobjects/qremoteobjectsource.cpp index ccff0e1..75b746d 100644 --- a/src/remoteobjects/qremoteobjectsource.cpp +++ b/src/remoteobjects/qremoteobjectsource.cpp @@ -177,8 +177,11 @@ QByteArray QtPrivate::qtro_classinfo_signature(const QMetaObject *metaObject) return QByteArray{}; } -inline bool qtro_is_cloned_method(const QMetaObject *mobj, int local_method_index) +inline bool qtro_is_cloned_method(const QMetaObject *mobj, int index) { + int local_method_index = index - mobj->methodOffset(); + if (local_method_index < 0 && mobj->superClass()) + return qtro_is_cloned_method(mobj->superClass(), index); const QtPrivate::Data data = QtPrivate::fromRelativeMethodIndex(mobj, local_method_index); if (data.flags() & 0x20 /*MethodFlags::MethodCloned*/) return true; @@ -293,9 +296,8 @@ void QRemoteObjectSourceBase::setConnections() const auto targetMeta = isAdapter ? m_adapter->metaObject() : meta; // don't connect cloned signals, or we end up with multiple emissions - if (qtro_is_cloned_method(targetMeta, sourceIndex - targetMeta->methodOffset())) + if (qtro_is_cloned_method(targetMeta, sourceIndex)) continue; - // This basically connects the parent Signals (note, all dynamic properties have onChange //notifications, thus signals) to us. Normally each Signal is mapped to a unique index, //but since we are forwarding them all, we keep the offset constant. |
