aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmetatype.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-02-23 12:17:44 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-02-24 13:43:51 +0000
commit844bdc7ba4168d90fbdfd09e687fb14df98d1d54 (patch)
tree4b59f881618a0e209186d442020c40119ca93b09 /src/qml/qml/qqmlmetatype.cpp
parentd8bc88775dd13335ad8912e16e535dd34d813e67 (diff)
QQmlMetaType: Don't duplicate notify signals for extended types
We have to add the methods first, so that the properties can be associated with their proper notification signals once we add them. If we add the properties first, the "missing" notification signals are synthesized. Fixes: QTBUG-101155 Change-Id: I1aacbf33a24f7a98d05dece77c804bd7cba8a041 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 57614680f760068c1db39888beba46944f409ff0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/qml/qml/qqmlmetatype.cpp')
-rw-r--r--src/qml/qml/qqmlmetatype.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index 4bca43c781..3c89246870 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -243,20 +243,7 @@ void QQmlMetaType::clone(QMetaObjectBuilder &builder, const QMetaObject *mo,
}
}
- // Clone Q_PROPERTY
- for (int ii = mo->propertyOffset(); ii < mo->propertyCount(); ++ii) {
- QMetaProperty property = mo->property(ii);
-
- int otherIndex = ignoreEnd->indexOfProperty(property.name());
- if (otherIndex >= ignoreStart->propertyOffset() + ignoreStart->propertyCount()) {
- builder.addProperty(QByteArray("__qml_ignore__") + property.name(), QByteArray("void"));
- // Skip
- } else {
- builder.addProperty(property);
- }
- }
-
- // Clone Q_METHODS
+ // Clone Q_METHODS - do this first to avoid duplicating the notify signals.
for (int ii = mo->methodOffset(); ii < mo->methodCount(); ++ii) {
QMetaMethod method = mo->method(ii);
@@ -280,6 +267,19 @@ void QQmlMetaType::clone(QMetaObjectBuilder &builder, const QMetaObject *mo,
m.setAccess(QMetaMethod::Private);
}
+ // Clone Q_PROPERTY
+ for (int ii = mo->propertyOffset(); ii < mo->propertyCount(); ++ii) {
+ QMetaProperty property = mo->property(ii);
+
+ int otherIndex = ignoreEnd->indexOfProperty(property.name());
+ if (otherIndex >= ignoreStart->propertyOffset() + ignoreStart->propertyCount()) {
+ builder.addProperty(QByteArray("__qml_ignore__") + property.name(), QByteArray("void"));
+ // Skip
+ } else {
+ builder.addProperty(property);
+ }
+ }
+
// Clone Q_ENUMS
for (int ii = mo->enumeratorOffset(); ii < mo->enumeratorCount(); ++ii) {
QMetaEnum enumerator = mo->enumerator(ii);