diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-08-19 03:35:29 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-08-19 03:35:29 (GMT) |
commit | f51450571addf2cb9a55153b209b8c1a45898193 (patch) | |
tree | 7ca8771b88d6123bf72b4b9e11d3d582d9428135 | |
parent | 56ccc5fdf6e2136df9c97b3ecdf7d1003549b546 (diff) | |
download | Qt-f51450571addf2cb9a55153b209b8c1a45898193.zip Qt-f51450571addf2cb9a55153b209b8c1a45898193.tar.gz Qt-f51450571addf2cb9a55153b209b8c1a45898193.tar.bz2 |
Fix setting the id property
the 'QString id' property wasn't getting set because we want id to be
treated specially. Added the corresponding special treatment to where it
should set the property.
Reviewed-by: Michael Brasser
To-be-reviewed-by: Aaron Kennedy
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index dea41ab..e04c876 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -1201,9 +1201,13 @@ bool QmlCompiler::buildProperty(QmlParser::Property *prop, // default property or to sub-objects (which are always in binding // sub-contexts) COMPILE_CHECK(buildIdProperty(prop, obj)); - if (prop->type == QVariant::String && - prop->values.at(0)->value.isString()) + if (prop->type == QVariant::String){ + if(!prop->values.at(0)->value.isString()){ + //Need to convert to string to assign to the QString id property + prop->values.at(0)->value = Variant(prop->values.at(0)->value.asString()); + } COMPILE_CHECK(buildPropertyAssignment(prop, obj, ctxt)); + } } else if (isAttachedPropertyName(prop->name)) { @@ -1629,7 +1633,7 @@ bool QmlCompiler::buildListProperty(QmlParser::Property *prop, // children: [ Item {}, Item {} ] // } // -// We allow assignming multiple values to single value properties +// We allow assigning multiple values to single value properties bool QmlCompiler::buildPropertyAssignment(QmlParser::Property *prop, QmlParser::Object *obj, const BindingContext &ctxt) |