aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-01-10 13:34:41 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-17 08:10:07 +0100
commitb92f33cddd3f2c4e35a9237791135dcc47a26985 (patch)
tree0c318917de61d9710544f82f2a6964f0ec615f0c /src
parentf596553e03c3969f6e7cb5344c05591da6e70dfb (diff)
[new compiler] Fix group property initializers
Bindings with an object initializer without a type name must be group properties, instead of regular object bindings. Fixes font { pixelSize: 24 } versus font.pixelSize: 24 Change-Id: I468caa48be13f91f88545ef001ac9aaa46ba5d14 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/compiler/qqmlcodegenerator.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/qml/compiler/qqmlcodegenerator.cpp b/src/qml/compiler/qqmlcodegenerator.cpp
index d1504b5baa..51881641cb 100644
--- a/src/qml/compiler/qqmlcodegenerator.cpp
+++ b/src/qml/compiler/qqmlcodegenerator.cpp
@@ -894,7 +894,13 @@ void QQmlCodeGenerator::appendBinding(const AST::SourceLocation &nameLocation, i
binding->location.line = nameLocation.startLine;
binding->location.column = nameLocation.startColumn;
binding->flags = 0;
- binding->type = QV4::CompiledData::Binding::Type_Object;
+
+ // No type name on the initializer means it must be a group property
+ if (stringAt(_objects.at(objectIndex)->inheritedTypeNameIndex).isEmpty())
+ binding->type = QV4::CompiledData::Binding::Type_GroupProperty;
+ else
+ binding->type = QV4::CompiledData::Binding::Type_Object;
+
binding->value.objectIndex = objectIndex;
_object->bindings->append(binding);
}