aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertycache.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-02-03 13:39:34 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2020-02-03 15:22:05 +0100
commit6f424f21b76b983188bb23715612f22437c098b5 (patch)
tree7b9f7a654f7cbbde67d69909d3609bb261ab9194 /src/qml/qml/qqmlpropertycache.cpp
parentb712003dce1c4cf96a72ffb2ef2e3176dddf7979 (diff)
Required properties: Do not fully resolve property caches
There's no need to have the property cache fully resolved when checking for required properties, and it introduces bugs as information for fully resolving the type is missing at that point. This would later cause errors in the QQmlPropertyValidator, due to the propType being wrong. Fixes: QTBUG-81806 Change-Id: I413cc3fab57f258f5e4cf4164c505312b10543e2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlpropertycache.cpp')
-rw-r--r--src/qml/qml/qqmlpropertycache.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp
index 0604e1e981..0e5534fc04 100644
--- a/src/qml/qml/qqmlpropertycache.cpp
+++ b/src/qml/qml/qqmlpropertycache.cpp
@@ -399,6 +399,19 @@ const QMetaObject *QQmlPropertyCache::createMetaObject()
return _metaObject;
}
+QQmlPropertyData *QQmlPropertyCache::maybeUnresolvedProperty(int index) const
+{
+ if (index < 0 || index >= (propertyIndexCacheStart + propertyIndexCache.count()))
+ return nullptr;
+
+ QQmlPropertyData *rv = nullptr;
+ if (index < propertyIndexCacheStart)
+ return _parent->maybeUnresolvedProperty(index);
+ else
+ rv = const_cast<QQmlPropertyData *>(&propertyIndexCache.at(index - propertyIndexCacheStart));
+ return rv;
+}
+
QQmlPropertyData *QQmlPropertyCache::defaultProperty() const
{
return property(defaultPropertyName(), nullptr, nullptr);