aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertyvalidator.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-12-03 01:11:42 +0100
committerUlf Hermann <ulf.hermann@qt.io>2022-01-18 12:51:38 +0100
commit5f76fabd0609f2a61b1ca53d88b6b76bb38e919a (patch)
tree604b1edcb9d690528a114c030cf8ddf5d93f746c /src/qml/qml/qqmlpropertyvalidator.cpp
parent26a97ace7cb9491a325f400b019d40f9413f0a68 (diff)
Move propertyCache- and metaObject-related functions into QQmlMetaType
That's where the data resides. This allows us to lock the mutex only once for all those methods, and it makes a large number of engine pointers unnecessary. Finally, we can now find the element type of a QQmlListProperty without supplying an engine. Change-Id: If1ae8eafe8762a112d1ca06f9c92ab8a727d1bda Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlpropertyvalidator.cpp')
-rw-r--r--src/qml/qml/qqmlpropertyvalidator.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlpropertyvalidator.cpp b/src/qml/qml/qqmlpropertyvalidator.cpp
index 91a5d8ec41..c91739c138 100644
--- a/src/qml/qml/qqmlpropertyvalidator.cpp
+++ b/src/qml/qml/qqmlpropertyvalidator.cpp
@@ -329,7 +329,7 @@ QVector<QQmlError> QQmlPropertyValidator::validateObject(
);
}
- if (!enginePrivate->propertyCacheForType(type)) {
+ if (!QQmlMetaType::propertyCacheForType(type)) {
return recordError(binding->location,
tr("Invalid grouped property access: Property \"%1\" with type \"%2\", which is not a value type")
.arg(name)
@@ -661,7 +661,7 @@ QQmlError QQmlPropertyValidator::validateLiteralBinding(
*/
bool QQmlPropertyValidator::canCoerce(QMetaType to, QQmlRefPointer<QQmlPropertyCache> fromMo) const
{
- QQmlRefPointer<QQmlPropertyCache> toMo = enginePrivate->rawPropertyCacheForType(to);
+ QQmlRefPointer<QQmlPropertyCache> toMo = QQmlMetaType::rawPropertyCacheForType(to);
if (toMo.isNull()) {
// if we have an inline component from the current file,
@@ -772,7 +772,7 @@ QQmlError QQmlPropertyValidator::validateObjectBinding(QQmlPropertyData *propert
// effect the properties on the type, but don't effect assignability
// Not passing a version ensures that we get the raw metaObject.
QQmlRefPointer<QQmlPropertyCache> propertyMetaObject
- = enginePrivate->rawPropertyCacheForType(propType);
+ = QQmlMetaType::rawPropertyCacheForType(propType);
if (!propertyMetaObject) {
// if we have an inline component from the current file,
// it is not properly registered at this point, as registration