aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-18 01:00:20 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-18 01:00:29 +0200
commit2c5c3fee1ceecdc3166c683a393db5dedb116303 (patch)
tree2dcdbc5a2a6a053b2e6f5c3c508d43d64e1e55be /src/qml/qml
parent137b2ac647fb8b51229273965e51421d637b2e7a (diff)
parente94718097e447e24753940203f78b96b3e1b958d (diff)
Merge "Merge remote-tracking branch 'origin/5.15' into dev"
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/qqmlcomponent.cpp5
-rw-r--r--src/qml/qml/qqmlcomponent_p.h1
-rw-r--r--src/qml/qml/qqmlincubator.cpp5
-rw-r--r--src/qml/qml/qqmlincubator_p.h1
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp2
-rw-r--r--src/qml/qml/qqmlobjectcreator_p.h2
6 files changed, 16 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index b72c745490..d651cbf636 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -345,6 +345,11 @@ RequiredProperties &QQmlComponentPrivate::requiredProperties()
return state.creator->requiredProperties();
}
+bool QQmlComponentPrivate::hadRequiredProperties() const
+{
+ return state.creator->componentHadRequiredProperties();
+}
+
void QQmlComponentPrivate::clear()
{
if (typeData) {
diff --git a/src/qml/qml/qqmlcomponent_p.h b/src/qml/qml/qqmlcomponent_p.h
index 8ae7672c19..a919eb45c0 100644
--- a/src/qml/qml/qqmlcomponent_p.h
+++ b/src/qml/qml/qqmlcomponent_p.h
@@ -108,6 +108,7 @@ public:
int start;
RequiredProperties& requiredProperties();
+ bool hadRequiredProperties() const;
QQmlRefPointer<QV4::ExecutableCompilationUnit> compilationUnit;
struct ConstructionState {
diff --git a/src/qml/qml/qqmlincubator.cpp b/src/qml/qml/qqmlincubator.cpp
index 7b3ae31c08..5c3ecbfb60 100644
--- a/src/qml/qml/qqmlincubator.cpp
+++ b/src/qml/qml/qqmlincubator.cpp
@@ -690,6 +690,11 @@ RequiredProperties &QQmlIncubatorPrivate::requiredProperties()
return creator->requiredProperties();
}
+bool QQmlIncubatorPrivate::hadRequiredProperties() const
+{
+ return creator->componentHadRequiredProperties();
+}
+
/*!
Stores a mapping from property names to initial values with which the incubated
component will be initialized
diff --git a/src/qml/qml/qqmlincubator_p.h b/src/qml/qml/qqmlincubator_p.h
index 731db7aad3..aadb147bd5 100644
--- a/src/qml/qml/qqmlincubator_p.h
+++ b/src/qml/qml/qqmlincubator_p.h
@@ -108,6 +108,7 @@ public:
void forceCompletion(QQmlInstantiationInterrupt &i);
void incubate(QQmlInstantiationInterrupt &i);
RequiredProperties &requiredProperties();
+ bool hadRequiredProperties() const;
};
QT_END_NAMESPACE
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index b723ddb381..d2e9d36d55 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -82,6 +82,7 @@ QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, const QQmlR
, propertyCaches(&compilationUnit->propertyCaches)
, sharedState(new QQmlObjectCreatorSharedState)
, topLevelCreator(true)
+ , hadRequiredProperties(false)
, incubator(incubator)
{
init(parentContext);
@@ -1523,6 +1524,7 @@ bool QQmlObjectCreator::populateInstance(int index, QObject *instance, QObject *
const QV4::CompiledData::Property* property = _compiledObject->propertiesBegin() + propertyIndex;
QQmlPropertyData *propertyData = _propertyCache->property(_propertyCache->propertyOffset() + propertyIndex);
if (property->isRequired) {
+ hadRequiredProperties = true;
sharedState->requiredProperties.insert(propertyData,
RequiredPropertyInfo {compilationUnit->stringAt(property->nameIndex), compilationUnit->finalUrl(), property->location, {}});
}
diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h
index ee1d82d4e3..c302660799 100644
--- a/src/qml/qml/qqmlobjectcreator_p.h
+++ b/src/qml/qml/qqmlobjectcreator_p.h
@@ -126,6 +126,7 @@ public:
QFiniteStack<QPointer<QObject> > &allCreatedObjects() { return sharedState->allCreatedObjects; }
RequiredProperties &requiredProperties() {return sharedState->requiredProperties;}
+ bool componentHadRequiredProperties() const {return hadRequiredProperties;}
private:
QQmlObjectCreator(QQmlContextData *contextData, const QQmlRefPointer<QV4::ExecutableCompilationUnit> &compilationUnit, QQmlObjectCreatorSharedState *inheritedSharedState);
@@ -172,6 +173,7 @@ private:
const QQmlPropertyCacheVector *propertyCaches;
QExplicitlySharedDataPointer<QQmlObjectCreatorSharedState> sharedState;
bool topLevelCreator;
+ bool hadRequiredProperties;
QQmlIncubatorPrivate *incubator;
QObject *_qobject;