diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2018-02-21 17:09:50 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-02-26 14:01:05 +0000 |
commit | ded165b94b9dd5eb01b1b879cfef5035efc418d0 (patch) | |
tree | 2eba972a235c2ea9de69a2b9e590a871650fbf24 /src/qml | |
parent | ec4c897ddab774b6ce873370bdc202f0bc7e76a3 (diff) |
Allow setting values in value type group properties in "on" assignments
Assigning to a group property inside a property value source or
interceptor as part of an "on assignment" is perfectly valid. That is
because while "color" is a value type property, the on assignment means
we're actually setting easing.type (in the example and test) on the
property value source, not the color, and that one is a QObject. The
same goes for interceptors.
Change-Id: I505a658977a578894d6dfb00bf5c65b41e42b12f
Task-number: QTBUG-56600
Reviewed-by: Michael Brasser <michael.brasser@live.com>
(cherry picked from commit 2659c308792967322564b5088e0e21bb371e0283)
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/compiler/qqmlpropertyvalidator.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/qml/compiler/qqmlpropertyvalidator.cpp b/src/qml/compiler/qqmlpropertyvalidator.cpp index 7ea89b378d..b30d06957d 100644 --- a/src/qml/compiler/qqmlpropertyvalidator.cpp +++ b/src/qml/compiler/qqmlpropertyvalidator.cpp @@ -196,7 +196,13 @@ QVector<QQmlCompileError> QQmlPropertyValidator::validateObject(int objectIndex, } if (binding->type >= QV4::CompiledData::Binding::Type_Object && (pd || binding->isAttachedProperty())) { - const QVector<QQmlCompileError> subObjectValidatorErrors = validateObject(binding->value.objectIndex, binding, pd && QQmlValueTypeFactory::metaObjectForMetaType(pd->propType())); + const bool populatingValueTypeGroupProperty + = pd + && QQmlValueTypeFactory::metaObjectForMetaType(pd->propType()) + && !(binding->flags & QV4::CompiledData::Binding::IsOnAssignment); + const QVector<QQmlCompileError> subObjectValidatorErrors + = validateObject(binding->value.objectIndex, binding, + populatingValueTypeGroupProperty); if (!subObjectValidatorErrors.isEmpty()) return subObjectValidatorErrors; } |