diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-04-03 17:20:18 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-04 17:26:20 +0200 |
commit | 2ee0b6ed788325cad73c3646ab2d72eadeeb1b0c (patch) | |
tree | a707c07143024b3fbe956f429d4daa5f5bf5ce60 /src | |
parent | 873f927fe225e2da9870997c73497c528e77e210 (diff) |
Regression: Fix id objects in group properties
Setting someGroupProperty.id should not be subject to the usual
restrictions with regards to valid values for id properties.
Task-number: QTBUG-38085
Change-Id: Ie66d9d4d4524ddaf5a6a0b0e260354db44d9995e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/compiler/qqmlirbuilder.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index 1c10a49fd1..0dac79f6e7 100644 --- a/src/qml/compiler/qqmlirbuilder.cpp +++ b/src/qml/compiler/qqmlirbuilder.cpp @@ -1275,6 +1275,10 @@ void IRBuilder::appendBinding(QQmlJS::AST::UiQualifiedId *name, QQmlJS::AST::Sta Object *object = 0; if (!resolveQualifiedId(&name, &object)) return; + if (_object == object && name->name == QStringLiteral("id")) { + setId(name->identifierToken, value); + return; + } qSwap(_object, object); appendBinding(qualifiedNameLocation, name->identifierToken, registerString(name->name.toString()), value); qSwap(_object, object); @@ -1293,11 +1297,6 @@ void IRBuilder::appendBinding(QQmlJS::AST::UiQualifiedId *name, int objectIndex, void IRBuilder::appendBinding(const QQmlJS::AST::SourceLocation &qualifiedNameLocation, const QQmlJS::AST::SourceLocation &nameLocation, quint32 propertyNameIndex, QQmlJS::AST::Statement *value) { - if (stringAt(propertyNameIndex) == QStringLiteral("id")) { - setId(nameLocation, value); - return; - } - Binding *binding = New<Binding>(); binding->propertyNameIndex = propertyNameIndex; binding->location.line = nameLocation.startLine; |