summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qml.h2
-rw-r--r--src/declarative/qml/qmlcompiler.cpp16
-rw-r--r--src/declarative/qml/qmlcomponent.cpp21
-rw-r--r--src/declarative/qml/qmlcontext.cpp8
-rw-r--r--src/declarative/qml/qmlparser.cpp1
-rw-r--r--src/declarative/qml/qmlparser_p.h1
-rw-r--r--src/declarative/qml/qmlvme.cpp6
7 files changed, 21 insertions, 34 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/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp
index 91bf1c0..fa36eb1 100644
--- a/src/declarative/qml/qmlcontext.cpp
+++ b/src/declarative/qml/qmlcontext.cpp
@@ -85,9 +85,11 @@ void QmlContextPrivate::destroyed(QObject *obj)
notifies.append(ii);
}
}
- for (int ii = 0; ii < notifies.count(); ++ii) {
- QMetaObject::activate(q, notifies[ii] + notifyIndex, 0);
- }
+
+ // ### Work around bug in shutdown
+ // for (int ii = 0; ii < notifies.count(); ++ii) {
+ // QMetaObject::activate(q, notifies[ii] + notifyIndex, 0);
+ // }
}
void QmlContextPrivate::init()
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 {
diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp
index 240dcc1..a0bce0a 100644
--- a/src/declarative/qml/qmlvme.cpp
+++ b/src/declarative/qml/qmlvme.cpp
@@ -282,11 +282,7 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in
}
if (!stack.isEmpty()) {
QObject *parent = stack.top();
- if (o->isWidgetType()) {
- qobject_cast<QWidget*>(o)->setParent(qobject_cast<QWidget*>(parent));
- } else {
- o->setParent(parent);
- }
+ o->setParent(parent);
}
stack.push(o);
}