aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlobjectcreator.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-01-22 16:00:13 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2020-01-28 13:19:34 +0100
commit4b1c40570300248a7a7744aa7ddf8e77457bdc2b (patch)
tree3ed8a22cc4eb709ec12669b9c0f9375818b4946e /src/qml/qml/qqmlobjectcreator.cpp
parent688ac0d553c531a673507db0139231e8f2acb379 (diff)
Handle required properties declared in C++
Fixes: QTBUG-81561 Change-Id: I97a0f5013b6e3662ffaad53c5cc871404e11a310 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator.cpp')
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index 198ce98f2d..a26cdba53a 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -1515,6 +1515,14 @@ bool QQmlObjectCreator::populateInstance(int index, QObject *instance, QObject *
}
}
+ for (int i = 0; i <= _propertyCache->propertyOffset(); ++i) {
+ QQmlPropertyData *propertyData = _propertyCache->property(i);
+ if (propertyData && propertyData->isRequired()) {
+ sharedState->hadRequiredProperties = true;
+ sharedState->requiredProperties.insert(propertyData, RequiredPropertyInfo {propertyData->name(_qobject), compilationUnit->finalUrl(), _compiledObject->location, {}});
+ }
+ }
+
if (_compiledObject->nFunctions > 0)
setupFunctions();
setupBindings();