diff options
author | Christopher Ham <christopher.ham@nokia.com> | 2011-01-28 06:03:22 (GMT) |
---|---|---|
committer | Christopher Ham <christopher.ham@nokia.com> | 2011-01-28 06:03:22 (GMT) |
commit | 74329f77d567e0b7e8cd4cab2ff6ce3f2b8892ad (patch) | |
tree | 69780dc6664a9b1f25d4d9fe1b76f66ea05a4adf /examples/declarative | |
parent | 281f449dfcb533448c0f2df955b4f5c059db7ba2 (diff) | |
download | Qt-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/declarative')
-rw-r--r-- | examples/declarative/toys/dynamicscene/qml/itemCreation.js | 7 |
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"); |