summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/declarative/dynamic/dynamic.qml8
-rw-r--r--src/declarative/qml/qmlobjectscriptclass.cpp1
2 files changed, 6 insertions, 3 deletions
diff --git a/examples/declarative/dynamic/dynamic.qml b/examples/declarative/dynamic/dynamic.qml
index 66fdf87..2c6a8e0 100644
--- a/examples/declarative/dynamic/dynamic.qml
+++ b/examples/declarative/dynamic/dynamic.qml
@@ -8,6 +8,7 @@ Rectangle {
Script { source: "dynamic.js" }
property bool extendStars: false
+ property var fourthBox: undefined
Item { id: targetItem; x: 100; y: 100; }
Item { id: targetItem2; x: 0; y: 300; }
@@ -20,7 +21,7 @@ Rectangle {
MouseRegion {
anchors.fill: parent
- onClicked: { a = createWithComponent(); }
+ onClicked: { var a = createWithComponent(); }
}
}
@@ -47,8 +48,8 @@ Rectangle {
MouseRegion {
anchors.fill: parent
onClicked: {
- if (fourthBox == null) {
- a = createQml(targetItem2);
+ if (fourthBox == null || fourthBox == undefined) {
+ var a = createQml(targetItem2);
if (a != null) {
a.parent = targetItem2;//BUG: this should happen automatically
fourthBox = a;
@@ -68,6 +69,7 @@ Rectangle {
Particles {
x: 0
y: 0
+ z: 10
count: 20
lifeSpan: 500
width: 100
diff --git a/src/declarative/qml/qmlobjectscriptclass.cpp b/src/declarative/qml/qmlobjectscriptclass.cpp
index 122db51..ae2cfcc 100644
--- a/src/declarative/qml/qmlobjectscriptclass.cpp
+++ b/src/declarative/qml/qmlobjectscriptclass.cpp
@@ -250,6 +250,7 @@ void QmlObjectScriptClass::setProperty(QObject *obj,
Q_ASSERT(lastData);
QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(engine);
+ Q_ASSERT(enginePriv->currentExpression);
// ### Can well known types be optimized?
QVariant v = QmlScriptClass::toVariant(engine, value);