summaryrefslogtreecommitdiffstats
path: root/examples/declarative/tutorials/samegame/samegame2/samegame.js
diff options
context:
space:
mode:
authorMorten Engvoldsen <morten.engvoldsen@nokia.com>2010-05-12 15:01:55 (GMT)
committerMorten Engvoldsen <morten.engvoldsen@nokia.com>2010-05-12 15:01:55 (GMT)
commitd41ccae68683dd0d35c20affec7e5c55ce6bca37 (patch)
tree270fe804f2b130243da4e714cc1a135690bc466d /examples/declarative/tutorials/samegame/samegame2/samegame.js
parent5987412720498aa22202a1bcca3cb988a9cf5606 (diff)
parent41cbfc5c8e6644ab21e92860db95b2e8da9aba6a (diff)
downloadQt-d41ccae68683dd0d35c20affec7e5c55ce6bca37.zip
Qt-d41ccae68683dd0d35c20affec7e5c55ce6bca37.tar.gz
Qt-d41ccae68683dd0d35c20affec7e5c55ce6bca37.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'examples/declarative/tutorials/samegame/samegame2/samegame.js')
-rw-r--r--examples/declarative/tutorials/samegame/samegame2/samegame.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.js b/examples/declarative/tutorials/samegame/samegame2/samegame.js
index e5c790d..0dbe6a6 100644
--- a/examples/declarative/tutorials/samegame/samegame2/samegame.js
+++ b/examples/declarative/tutorials/samegame/samegame2/samegame.js
@@ -37,17 +37,16 @@ function createBlock(column, row) {
if (component == null)
component = Qt.createComponent("Block.qml");
- // Note that if Block.qml was not a local file, component.isReady would be
- // false and we should wait for the component's statusChanged() signal to
- // know when the file is downloaded and fully loaded before calling createObject().
- if (component.isReady) {
- var dynamicObject = component.createObject();
+ // Note that if Block.qml was not a local file, component.status would be
+ // Loading and we should wait for the component's statusChanged() signal to
+ // know when the file is downloaded and ready before calling createObject().
+ if (component.status == Component.Ready) {
+ var dynamicObject = component.createObject(background);
if (dynamicObject == null) {
console.log("error creating block");
console.log(component.errorsString());
return false;
}
- dynamicObject.parent = background;
dynamicObject.x = column * blockSize;
dynamicObject.y = row * blockSize;
dynamicObject.width = blockSize;