From d27d896d8cb9d240138fe8ea69f1051f74ce1945 Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Mon, 21 Jan 2019 10:02:01 +0100 Subject: [PATCH] Improve error message Show more datails about what actually went wrong. Change-Id: I418a4d1f433bd4d440fc34e9a4932a9ea010b174 Reviewed-by: Ulf Hermann --- src/qml/compiler/qqmlpropertyvalidator.cpp | 6 +++++- .../qqmllanguage/data/invalidGroupedProperty.1.errors.txt | 2 +- .../qqmllanguage/data/invalidGroupedProperty.3.errors.txt | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/qml/compiler/qqmlpropertyvalidator.cpp b/src/qml/compiler/qqmlpropertyvalidator.cpp index 4cb922ca8d..25dcaa0c2d 100644 --- a/src/qml/compiler/qqmlpropertyvalidator.cpp +++ b/src/qml/compiler/qqmlpropertyvalidator.cpp @@ -276,7 +276,11 @@ QVector QQmlPropertyValidator::validateObject(int objectIndex, } } else { if (!enginePrivate->propertyCacheForType(pd->propType())) { - return recordError(binding->location, tr("Invalid grouped property access")); + return recordError(binding->location, + tr("Invalid grouped property access: Property \"%1\" with type \"%2\", which is not a value type") + .arg(name) + .arg(QString::fromLatin1(QMetaType::typeName(pd->propType()))) + ); } } } diff --git a/tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.1.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.1.errors.txt index 810fd31b41..d76f18ba89 100644 --- a/tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.1.errors.txt +++ b/tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.1.errors.txt @@ -1 +1 @@ -5:5:Invalid grouped property access +5:5:Invalid grouped property access: Property "o" with type "QVariant", which is not a value type diff --git a/tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.3.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.3.errors.txt index f6d6f29fbf..9a0422753f 100644 --- a/tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.3.errors.txt +++ b/tests/auto/qml/qqmllanguage/data/invalidGroupedProperty.3.errors.txt @@ -1 +1 @@ -4:5:Invalid grouped property access +4:5:Invalid grouped property access: Property "customType" with type "MyCustomVariantType", which is not a value type