From 38420b1f63162802ede4861faf6d34dfa956d486 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 19 May 2010 16:38:37 +0200 Subject: Fix dynamicscene example In all the renaming (presumably) the moon broke, now fixed. Also made it slightly smaller, to be friendlier to desktop systems with small screens (and the fixed size qtdemo) --- examples/declarative/toys/dynamicscene/dynamicscene.qml | 10 ++++++---- .../declarative/toys/dynamicscene/qml/GenericSceneItem.qml | 9 +++++++++ examples/declarative/toys/dynamicscene/qml/itemCreation.js | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 examples/declarative/toys/dynamicscene/qml/GenericSceneItem.qml diff --git a/examples/declarative/toys/dynamicscene/dynamicscene.qml b/examples/declarative/toys/dynamicscene/dynamicscene.qml index 52c7c1e..2aa15e5 100644 --- a/examples/declarative/toys/dynamicscene/dynamicscene.qml +++ b/examples/declarative/toys/dynamicscene/dynamicscene.qml @@ -8,7 +8,8 @@ Item { property int activeSuns: 0 //This is a desktop-sized example - width: 1024; height: 512 + width: 800; height: 480 + //This is the message box that pops up when there's an error Rectangle { @@ -79,7 +80,7 @@ Item { Rectangle { id: toolbox - width: 480 + width: 380 color: activePalette.window anchors { right: parent.right; top: parent.top; bottom: parent.bottom } @@ -132,7 +133,7 @@ Item { Text { text: "Arbitrary QML:" } Rectangle { - width: 460; height: 240 + width: 360; height: 240 TextEdit { id: qmlText @@ -140,8 +141,9 @@ Item { readOnly: false focusOnPress: true font.pixelSize: 14 + wrapMode: TextEdit.WordWrap - text: "import Qt 4.7\nImage {\n id: smile\n x: 500 * Math.random()\n y: 200 * Math.random() \n source: 'images/face-smile.png'\n\n NumberAnimation on opacity { \n to: 0; duration: 1500\n }\n\n Component.onCompleted: smile.destroy(1500);\n}" + text: "import Qt 4.7\nImage {\n id: smile\n x: 360 * Math.random()\n y: 180 * Math.random() \n source: 'images/face-smile.png'\n NumberAnimation on opacity { \n to: 0; duration: 1500\n }\n Component.onCompleted: smile.destroy(1500);\n}" } } diff --git a/examples/declarative/toys/dynamicscene/qml/GenericSceneItem.qml b/examples/declarative/toys/dynamicscene/qml/GenericSceneItem.qml new file mode 100644 index 0000000..de096ad --- /dev/null +++ b/examples/declarative/toys/dynamicscene/qml/GenericSceneItem.qml @@ -0,0 +1,9 @@ +import Qt 4.7 + +Image { + property bool created: false + property string image + + source: image + +} diff --git a/examples/declarative/toys/dynamicscene/qml/itemCreation.js b/examples/declarative/toys/dynamicscene/qml/itemCreation.js index 59750f3..443c448 100644 --- a/examples/declarative/toys/dynamicscene/qml/itemCreation.js +++ b/examples/declarative/toys/dynamicscene/qml/itemCreation.js @@ -36,7 +36,7 @@ function createItem() { } else if (itemComponent.status == Component.Error) { draggedItem = null; console.log("error creating component"); - console.log(component.errorsString()); + console.log(itemComponent.errorsString()); } } -- cgit v0.12