diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-03-31 13:23:39 (GMT) |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-03-31 13:24:56 (GMT) |
commit | 5746327c5566223f01f10f62baf8d7c3e47a6c9f (patch) | |
tree | 32627619eadf2ae18d0c3aa12044ff8ba06f5aba /src/declarative/qml/qdeclarativescriptparser.cpp | |
parent | 0373325dd1390682922dd07614214c453d473ce3 (diff) | |
download | Qt-5746327c5566223f01f10f62baf8d7c3e47a6c9f.zip Qt-5746327c5566223f01f10f62baf8d7c3e47a6c9f.tar.gz Qt-5746327c5566223f01f10f62baf8d7c3e47a6c9f.tar.bz2 |
Fixed: Declared properties cannot be assigned in declaration
Task-number: QTBUG-7860
Diffstat (limited to 'src/declarative/qml/qdeclarativescriptparser.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativescriptparser.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/declarative/qml/qdeclarativescriptparser.cpp b/src/declarative/qml/qdeclarativescriptparser.cpp index 9fff294..2b9cd4b 100644 --- a/src/declarative/qml/qdeclarativescriptparser.cpp +++ b/src/declarative/qml/qdeclarativescriptparser.cpp @@ -397,7 +397,7 @@ Object *ProcessAST::defineObjectBinding(AST::UiQualifiedId *qualifiedId, bool on if (string.isStringList()) { QStringList urls = string.asStringList(); // We need to add this as a resource - for (int ii = 0; ii < urls.count(); ++ii) + for (int ii = 0; ii < urls.count(); ++ii) _parser->_refUrls << QUrl(urls.at(ii)); } } @@ -503,7 +503,7 @@ bool ProcessAST::visit(AST::UiImport *node) error.setColumn(node->importIdToken.startColumn); _parser->_errors << error; return false; - } + } import.location = location(startLoc, endLoc); @@ -637,7 +637,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node) property.isDefaultProperty = node->isDefaultMember; property.type = type; if (type >= Object::DynamicProperty::Custom) { - QDeclarativeScriptParser::TypeReference *typeRef = + QDeclarativeScriptParser::TypeReference *typeRef = _parser->findOrCreateType(memberType); typeRef->refObjects.append(_stateStack.top().object); } @@ -660,9 +660,12 @@ bool ProcessAST::visit(AST::UiPublicMember *node) } _stateStack.top().object->dynamicProperties << property; + + // process QML-like initializers (e.g. property Object o: Object {}) + accept(node->binding); } - return true; + return false; } @@ -996,7 +999,7 @@ QDeclarativeParser::Object::ScriptBlock::Pragmas QDeclarativeScriptParser::extra for (int ii = 0; ii < length; ++ii) { const QChar &c = data[ii]; - if (c.isSpace()) + if (c.isSpace()) continue; if (c == forwardSlash) { |