diff options
author | Rainer Keller <Rainer.Keller@qt.io> | 2018-06-04 10:15:33 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-06-25 10:38:54 +0000 |
commit | fbc48d2631af04c2942b407e4acea53c82a60e1b (patch) | |
tree | 5e330b2d5ee91451cba62360a97c5b78d6e2585c /src/qml/compiler/qqmlpropertyvalidator.cpp | |
parent | f319fcf70917c392913cf6db6115d18623dd4fd5 (diff) |
Improve error message
Show information about used types to help the user determine
what went wrong.
Change-Id: Ia71f21ee2bd53ba751bf0a3f7718f949d0e8330d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qqmlpropertyvalidator.cpp')
-rw-r--r-- | src/qml/compiler/qqmlpropertyvalidator.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/compiler/qqmlpropertyvalidator.cpp b/src/qml/compiler/qqmlpropertyvalidator.cpp index 8ebd2da1c9..afa2e4ad81 100644 --- a/src/qml/compiler/qqmlpropertyvalidator.cpp +++ b/src/qml/compiler/qqmlpropertyvalidator.cpp @@ -693,7 +693,8 @@ QQmlCompileError QQmlPropertyValidator::validateObjectBinding(QQmlPropertyData * } if (!isAssignable) { - return QQmlCompileError(binding->valueLocation, tr("Cannot assign object to property")); + return QQmlCompileError(binding->valueLocation, tr("Cannot assign object of type \"%1\" to property of type \"%2\" as the former is neither the same as the latter nor a sub-class of it.") + .arg(stringAt(qmlUnit->objectAt(binding->value.objectIndex)->inheritedTypeNameIndex)).arg(QLatin1String(QMetaType::typeName(property->propType())))); } } return noError; |