aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-11-24 15:15:13 +0100
committerUlf Hermann <ulf.hermann@qt.io>2022-11-28 14:11:44 +0100
commitb6ba7e9c9023d1d5c6ba543c1c551344b7a9e5b5 (patch)
tree19ab013570976ea1191134f85f8115944a2e9866 /src/qml/qml/qqmlobjectcreator.cpp
parent6acf343acb532ad0579f8261ea281af3eb59da28 (diff)
Key required properties by object and property data
Property data alone is not enough as the same property can be required in multiple objects. Fixes: QTBUG-108291 Change-Id: I3b1c899e24bb2967d05372701f9b5d0927b3c711 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index b85a6c1220..b000a10b13 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -694,8 +694,9 @@ void QQmlObjectCreator::setupBindings(BindingSetupFlags mode)
QQmlData *data = QQmlData::get(targetObject);
Q_ASSERT(data && data->propertyCache);
targetProperty = data->propertyCache->property(targetIndex.coreIndex());
+ sharedState->requiredProperties.remove({targetObject, targetProperty});
}
- sharedState->requiredProperties.remove(targetProperty);
+ sharedState->requiredProperties.remove({_bindingTarget, property});
}
@@ -1563,7 +1564,7 @@ bool QQmlObjectCreator::populateInstance(int index, QObject *instance, QObject *
postHocRequired.erase(postHocIt);
if (isContextObject)
sharedState->hadTopLevelRequiredProperties = true;
- sharedState->requiredProperties.insert(propertyData,
+ sharedState->requiredProperties.insert({_qobject, propertyData},
RequiredPropertyInfo {compilationUnit->stringAt(property->nameIndex), compilationUnit->finalUrl(), property->location, {}});
}
@@ -1623,7 +1624,7 @@ bool QQmlObjectCreator::populateInstance(int index, QObject *instance, QObject *
if (isContextObject)
sharedState->hadTopLevelRequiredProperties = true;
sharedState->requiredProperties.insert(
- propertyData,
+ {_qobject, propertyData},
RequiredPropertyInfo {
name, compilationUnit->finalUrl(), _compiledObject->location, {} });
}
@@ -1654,7 +1655,7 @@ bool QQmlObjectCreator::populateInstance(int index, QObject *instance, QObject *
if (isContextObject)
sharedState->hadTopLevelRequiredProperties = true;
sharedState->requiredProperties.insert(
- propertyData,
+ {_qobject, propertyData},
RequiredPropertyInfo {
name, compilationUnit->finalUrl(), _compiledObject->location, {} });
}
@@ -1687,7 +1688,7 @@ bool QQmlObjectCreator::populateInstance(int index, QObject *instance, QObject *
const QQmlPropertyData *const targetProperty = targetDData->propertyCache->property(coreIndex);
if (!targetProperty)
continue;
- auto it = sharedState->requiredProperties.find(targetProperty);
+ auto it = sharedState->requiredProperties.find({target, targetProperty});
if (it != sharedState->requiredProperties.end())
it->aliasesToRequired.push_back(
AliasToRequiredInfo {