aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcompiler.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-01-24 13:13:58 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-28 08:59:29 +0100
commit118c2d30b9d031175dfff3085264be5612e4a419 (patch)
tree6978431e5d628e2016334820cd57c51c180a58d9 /src/qml/qml/qqmlcompiler.cpp
parent6c5b42b47e4b8b08d5188019171c779b3748236d (diff)
Improved error handling for namespaced property bindings
A binding with a qualified name that starts with a name space, must be followed by a type. For example MyNamespace.someThing.foo: 100 is not valid, something must be a valid type name and therefore start with an upper case letter. Similarly an object declaration like this: MyNamespace.something { ... } is not valid neither. The current compiler reported the latter as "Expected type" and the former as "Invalid attached property name". The message for the latter is not very good, because we know that "MyNamespace" is a namespace and therefore "something" cannot be a attached property name, it must be the attached property type first. In the new compiler this hits the same code path and thus the same error message. So this patch introduces the correct error message in the new compiler, adjusts it for attached properties in the old one and adjusts the test that now passes with both. Change-Id: I51c265a2acb80079c1dd62ef5ef77d5ff07d3ac1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcompiler.cpp')
-rw-r--r--src/qml/qml/qqmlcompiler.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp
index e36f3fd967..0dd4ea015d 100644
--- a/src/qml/qml/qqmlcompiler.cpp
+++ b/src/qml/qml/qqmlcompiler.cpp
@@ -1925,7 +1925,7 @@ bool QQmlCompiler::buildPropertyInNamespace(QQmlImportNamespace *ns,
for (Property *prop = nsProp->value->properties.first(); prop; prop = nsProp->value->properties.next(prop)) {
if (!isAttachedPropertyName(prop->name()))
- COMPILE_EXCEPTION(prop, tr("Not an attached property name"));
+ COMPILE_EXCEPTION(prop, tr("Expected type name"));
// Setup attached property data