diff options
author | Thomas Hartmann <[email protected]> | 2017-09-14 14:38:36 +0200 |
---|---|---|
committer | Thomas Hartmann <[email protected]> | 2018-01-12 09:05:54 +0000 |
commit | 9643635f867b67e263d1c615965a93a1579f8b34 (patch) | |
tree | 9f70e44a985c44651a1b12cca37517d263f9d378 /src/qml/compiler/qqmlpropertyvalidator.cpp | |
parent | 4588e73020731c5e9527734f89bc55f7630435e1 (diff) |
Allow exported signal handlers for signals with revision
Properties of QML objects or alias properties to QML objects
have to know about the revision of the QML type.
If the property is used as a grouped property and a signal or property
is assigned.
Without this patch this is not working with signals that have a revision.
To get this working we store the minor version of the QML type in
QQmlPropertyData and retrieve the QQmlPropertyCache with the correct
AllowedRevisionCache using this minor version.
Task-number: QTCREATORBUG-18820
Change-Id: I1e20169e0d5a2ae11059a951aa83a5c94106accb
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/compiler/qqmlpropertyvalidator.cpp')
-rw-r--r-- | src/qml/compiler/qqmlpropertyvalidator.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/compiler/qqmlpropertyvalidator.cpp b/src/qml/compiler/qqmlpropertyvalidator.cpp index 7ea89b378d..9fde6848bb 100644 --- a/src/qml/compiler/qqmlpropertyvalidator.cpp +++ b/src/qml/compiler/qqmlpropertyvalidator.cpp @@ -665,10 +665,11 @@ QQmlCompileError QQmlPropertyValidator::validateObjectBinding(QQmlPropertyData * } else if (property->propType() == qMetaTypeId<QQmlScriptString>()) { return QQmlCompileError(binding->valueLocation, tr("Invalid property assignment: script expected")); } else { - // We want to raw metaObject here as the raw metaobject is the + // We want to use the raw metaObject here as the raw metaobject is the // actual property type before we applied any extensions that might // effect the properties on the type, but don't effect assignability - QQmlPropertyCache *propertyMetaObject = enginePrivate->rawPropertyCacheForType(property->propType()); + // Using -1 for the minor version ensures that we get the raw metaObject. + QQmlPropertyCache *propertyMetaObject = enginePrivate->rawPropertyCacheForType(property->propType(), -1); // Will be true if the assgned type inherits propertyMetaObject bool isAssignable = false; |