summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChristopher Ham <christopher.ham@nokia.com>2011-01-28 06:03:22 (GMT)
committerChristopher Ham <christopher.ham@nokia.com>2011-01-28 06:03:22 (GMT)
commit74329f77d567e0b7e8cd4cab2ff6ce3f2b8892ad (patch)
tree69780dc6664a9b1f25d4d9fe1b76f66ea05a4adf /examples
parent281f449dfcb533448c0f2df955b4f5c059db7ba2 (diff)
downloadQt-74329f77d567e0b7e8cd4cab2ff6ce3f2b8892ad.zip
Qt-74329f77d567e0b7e8cd4cab2ff6ce3f2b8892ad.tar.gz
Qt-74329f77d567e0b7e8cd4cab2ff6ce3f2b8892ad.tar.bz2
Update Docs, Examples and Demos for new CreateObject overloadable
Dynamic object in Docs explains QScriptValue argument. SameGame and Dynamic scene now make use of overloadable. Task-number: QTBUG-13087 Reviewed-by: Bea Lam
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/toys/dynamicscene/qml/itemCreation.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/examples/declarative/toys/dynamicscene/qml/itemCreation.js b/examples/declarative/toys/dynamicscene/qml/itemCreation.js
index e74f7b0..4ee74c2 100644
--- a/examples/declarative/toys/dynamicscene/qml/itemCreation.js
+++ b/examples/declarative/toys/dynamicscene/qml/itemCreation.js
@@ -28,11 +28,8 @@ function loadComponent() {
function createItem() {
if (itemComponent.status == Component.Ready && draggedItem == null) {
- draggedItem = itemComponent.createObject(window);
- draggedItem.image = paletteItem.image;
- draggedItem.x = posnInWindow.x;
- draggedItem.y = posnInWindow.y;
- draggedItem.z = 3; // make sure created item is above the ground layer
+ draggedItem = itemComponent.createObject(window, {"image": paletteItem.image, "x": posnInWindow.x, "y": posnInWindow.y, "z": 3});
+ // make sure created item is above the ground layer
} else if (itemComponent.status == Component.Error) {
draggedItem = null;
console.log("error creating component");