diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-12 07:33:32 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-05-12 07:33:32 (GMT) |
commit | 893404a0ad649ba12d3ada2e94cc17cf77b96127 (patch) | |
tree | 82444cd087375b6c50fea9a981e7c533eef78d0b /src/declarative/qml | |
parent | e605366e234af3008942f4029079c2cb84465c69 (diff) | |
download | Qt-893404a0ad649ba12d3ada2e94cc17cf77b96127.zip Qt-893404a0ad649ba12d3ada2e94cc17cf77b96127.tar.gz Qt-893404a0ad649ba12d3ada2e94cc17cf77b96127.tar.bz2 |
More tests
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qml.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlcompiler.cpp | 16 | ||||
-rw-r--r-- | src/declarative/qml/qmlcomponent.cpp | 21 | ||||
-rw-r--r-- | src/declarative/qml/qmlparser.cpp | 1 | ||||
-rw-r--r-- | src/declarative/qml/qmlparser_p.h | 1 |
5 files changed, 15 insertions, 26 deletions
diff --git a/src/declarative/qml/qml.h b/src/declarative/qml/qml.h index 1c662a7..b435e94 100644 --- a/src/declarative/qml/qml.h +++ b/src/declarative/qml/qml.h @@ -106,7 +106,7 @@ QObject *qmlAttachedPropertiesObject(const QObject *obj) if (idx == -1 || !obj) return 0; - return qmlAttachedPropertiesObjectById(obj, idx); + return qmlAttachedPropertiesObjectById(idx, obj); } QML_DECLARE_TYPE(QObject); diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index a703ec3..ed520c1 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -863,9 +863,9 @@ bool QmlCompiler::compileIdProperty(QmlParser::Property *prop, QmlParser::Object *obj) { if (prop->value) - COMPILE_EXCEPTION("The 'id' property cannot be fetched"); + COMPILE_EXCEPTION2(prop,"The id property cannot be fetched"); if (prop->values.count() > 1) - COMPILE_EXCEPTION("The 'id' property cannot be multiset"); + COMPILE_EXCEPTION2(prop, "The object id may only be set once"); if (prop->values.count() == 1) { if (prop->values.at(0)->object) @@ -1018,6 +1018,7 @@ bool QmlCompiler::compileListProperty(QmlParser::Property *prop, if (assignedBinding) COMPILE_EXCEPTION("Can only assign one binding to lists"); + assignedBinding = true; compileBinding(v->value.asScript(), prop, ctxt, obj->metaObject(), v->location.start.line); v->type = Value::PropertyBinding; @@ -1305,17 +1306,6 @@ bool QmlCompiler::compileDynamicMeta(QmlParser::Object *obj) p.defaultValue->isDefault = false; COMPILE_CHECK(compileProperty(p.defaultValue, obj, 0)); } - - if (!p.onValueChanged.isEmpty()) { - QmlInstruction assign; - assign.type = QmlInstruction::AssignSignal; - assign.line = obj->location.start.line; - assign.assignSignal.signal = - output->indexForByteArray(p.name + "Changed()"); - assign.assignSignal.value = - output->indexForString(p.onValueChanged); - output->bytecode << assign; - } } return true; diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp index da8f26d..24b5dd2 100644 --- a/src/declarative/qml/qmlcomponent.cpp +++ b/src/declarative/qml/qmlcomponent.cpp @@ -482,18 +482,19 @@ QObject *QmlComponent::beginCreate(QmlContext *context) ctxt->deactivate(); + QmlEnginePrivate *ep = d->engine->d_func(); + if (ep->rootComponent == this) { + ep->rootComponent = 0; + + d->bindValues = ep->bindValues; + d->parserStatus = ep->parserStatus; + ep->bindValues.clear(); + ep->parserStatus.clear(); + d->completePending = true; + } + if (rv) { QFx_setParent_noEvent(ctxt, rv); - QmlEnginePrivate *ep = d->engine->d_func(); - if (ep->rootComponent == this) { - ep->rootComponent = 0; - - d->bindValues = ep->bindValues; - d->parserStatus = ep->parserStatus; - ep->bindValues.clear(); - ep->parserStatus.clear(); - d->completePending = true; - } } else { delete ctxt; } diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp index bafdb02..10eec61 100644 --- a/src/declarative/qml/qmlparser.cpp +++ b/src/declarative/qml/qmlparser.cpp @@ -109,7 +109,6 @@ QmlParser::Object::DynamicProperty::DynamicProperty(const DynamicProperty &o) : isDefaultProperty(o.isDefaultProperty), type(o.type), name(o.name), - onValueChanged(o.onValueChanged), defaultValue(o.defaultValue) { } diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h index f25a76b..a6894fb 100644 --- a/src/declarative/qml/qmlparser_p.h +++ b/src/declarative/qml/qmlparser_p.h @@ -133,7 +133,6 @@ namespace QmlParser bool isDefaultProperty; Type type; QByteArray name; - QString onValueChanged; QmlParser::Property *defaultValue; }; struct DynamicSignal { |