diff options
Diffstat (limited to 'demos/declarative')
24 files changed, 59 insertions, 46 deletions
diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml index d9b73ed..54af7ad 100644 --- a/demos/declarative/calculator/calculator.qml +++ b/demos/declarative/calculator/calculator.qml @@ -118,7 +118,7 @@ Rectangle { } transitions: Transition { - NumberAnimation { matchProperties: "x,y,width"; easing: "easeOutBounce"; duration: 500 } - NumberAnimation { matchProperties: "opacity"; easing: "easeInOutQuad"; duration: 500 } + NumberAnimation { properties: "x,y,width"; easing: "easeOutBounce"; duration: 500 } + NumberAnimation { properties: "opacity"; easing: "easeInOutQuad"; duration: 500 } } } diff --git a/demos/declarative/flickr/common/ImageDetails.qml b/demos/declarative/flickr/common/ImageDetails.qml index 95c32e8..19cad06 100644 --- a/demos/declarative/flickr/common/ImageDetails.qml +++ b/demos/declarative/flickr/common/ImageDetails.qml @@ -149,7 +149,7 @@ Flipable { property: "smooth" value: false } - NumberAnimation { easing: "easeInOutQuad"; matchProperties: "angle"; duration: 500 } + NumberAnimation { easing: "easeInOutQuad"; properties: "angle"; duration: 500 } PropertyAction { target: bigImage property: "smooth" diff --git a/demos/declarative/flickr/common/Loading.qml b/demos/declarative/flickr/common/Loading.qml index 64a04c4..174cd21 100644 --- a/demos/declarative/flickr/common/Loading.qml +++ b/demos/declarative/flickr/common/Loading.qml @@ -3,6 +3,6 @@ import Qt 4.6 Image { id: loading; source: "pics/loading.png"; transformOrigin: "Center" rotation: NumberAnimation { - id: "RotationAnimation"; from: 0; to: 360; running: loading.visible == true; repeat: true; duration: 900 + from: 0; to: 360; running: loading.visible == true; repeat: true; duration: 900 } } diff --git a/demos/declarative/flickr/common/MediaLineEdit.qml b/demos/declarative/flickr/common/MediaLineEdit.qml index abc8034..b24b296 100644 --- a/demos/declarative/flickr/common/MediaLineEdit.qml +++ b/demos/declarative/flickr/common/MediaLineEdit.qml @@ -42,7 +42,7 @@ Item { ] transitions: [ Transition { - NumberAnimation { matchProperties: "x,width"; duration: 500; easing: "easeInOutQuad" } + NumberAnimation { properties: "x,width"; duration: 500; easing: "easeInOutQuad" } } ] diff --git a/demos/declarative/flickr/common/ScrollBar.qml b/demos/declarative/flickr/common/ScrollBar.qml index 2c1ec8a..feebcb0 100644 --- a/demos/declarative/flickr/common/ScrollBar.qml +++ b/demos/declarative/flickr/common/ScrollBar.qml @@ -32,7 +32,7 @@ Item { to: "*" NumberAnimation { target: container - matchProperties: "opacity" + properties: "opacity" duration: 400 } } diff --git a/demos/declarative/flickr/common/Star.qml b/demos/declarative/flickr/common/Star.qml index c5abcca..173021b 100644 --- a/demos/declarative/flickr/common/Star.qml +++ b/demos/declarative/flickr/common/Star.qml @@ -37,7 +37,7 @@ Item { transitions: [ Transition { NumberAnimation { - matchProperties: "opacity,scale,x,y" + properties: "opacity,scale,x,y" easing: "easeOutBounce" } } diff --git a/demos/declarative/flickr/flickr-desktop.qml b/demos/declarative/flickr/flickr-desktop.qml index 4e3b6cb..3848f12 100644 --- a/demos/declarative/flickr/flickr-desktop.qml +++ b/demos/declarative/flickr/flickr-desktop.qml @@ -86,15 +86,15 @@ Item { from: "*"; to: "Details" SequentialAnimation { ParentAction { } - NumberAnimation { matchProperties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } + NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } } }, Transition { from: "Details"; to: "*" SequentialAnimation { ParentAction { } - NumberAnimation { matchProperties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } - PropertyAction { matchTargets: wrapper; matchProperties: "z" } + NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } + PropertyAction { targets: wrapper; properties: "z" } } } ] @@ -180,7 +180,7 @@ Item { transitions: [ Transition { from: "*"; to: "*" - NumberAnimation { matchProperties: "y"; duration: 1000; easing: "easeOutBounce(amplitude:0.5)" } + NumberAnimation { properties: "y"; duration: 1000; easing: "easeOutBounce(amplitude:0.5)" } } ] } diff --git a/demos/declarative/flickr/flickr-mobile.qml b/demos/declarative/flickr/flickr-mobile.qml index 583f992..0a89c4f 100644 --- a/demos/declarative/flickr/flickr-mobile.qml +++ b/demos/declarative/flickr/flickr-mobile.qml @@ -38,7 +38,7 @@ Item { } transitions: Transition { - NumberAnimation { matchProperties: "x"; duration: 500; easing: "easeInOutQuad" } + NumberAnimation { properties: "x"; duration: 500; easing: "easeInOutQuad" } } } @@ -76,7 +76,7 @@ Item { } transitions: Transition { - NumberAnimation { matchProperties: "x"; duration: 500; easing: "easeInOutQuad" } + NumberAnimation { properties: "x"; duration: 500; easing: "easeInOutQuad" } } } } diff --git a/demos/declarative/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/mobile/GridDelegate.qml index 3a42507..6c12896 100644 --- a/demos/declarative/flickr/mobile/GridDelegate.qml +++ b/demos/declarative/flickr/mobile/GridDelegate.qml @@ -55,14 +55,14 @@ Transition { from: "Show"; to: "Details" ParentAction { } - NumberAnimation { matchProperties: "x,y"; duration: 500; easing: "easeInOutQuad" } + NumberAnimation { properties: "x,y"; duration: 500; easing: "easeInOutQuad" } }, Transition { from: "Details"; to: "Show" SequentialAnimation { ParentAction { } - NumberAnimation { matchProperties: "x,y"; duration: 500; easing: "easeInOutQuad" } - PropertyAction { matchTargets: wrapper; matchProperties: "z" } + NumberAnimation { properties: "x,y"; duration: 500; easing: "easeInOutQuad" } + PropertyAction { targets: wrapper; properties: "z" } } } ] diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml index 9116428..1963bf5 100644 --- a/demos/declarative/flickr/mobile/ImageDetails.qml +++ b/demos/declarative/flickr/mobile/ImageDetails.qml @@ -117,7 +117,7 @@ Flipable { transitions: Transition { SequentialAnimation { PropertyAction { target: bigImage; property: "smooth"; value: false } - NumberAnimation { easing: "easeInOutQuad"; matchProperties: "angle"; duration: 500 } + NumberAnimation { easing: "easeInOutQuad"; properties: "angle"; duration: 500 } PropertyAction { target: bigImage; property: "smooth"; value: !flickable.moving } } } diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml index 0341585..07b9762 100644 --- a/demos/declarative/flickr/mobile/TitleBar.qml +++ b/demos/declarative/flickr/mobile/TitleBar.qml @@ -71,6 +71,6 @@ Item { } transitions: Transition { - NumberAnimation { matchProperties: "x"; easing: "easeInOutQuad" } + NumberAnimation { properties: "x"; easing: "easeInOutQuad" } } } diff --git a/demos/declarative/minehunt/main.cpp b/demos/declarative/minehunt/main.cpp index 8ca37ff..0b862e3 100644 --- a/demos/declarative/minehunt/main.cpp +++ b/demos/declarative/minehunt/main.cpp @@ -167,10 +167,7 @@ MyWidget::MyWidget(int width, int height, QWidget *parent, Qt::WindowFlags flags canvas->setFixedSize(width, height); vbox->addWidget(canvas); - QFile file(fileName); - file.open(QFile::ReadOnly); - QString qml = file.readAll(); - canvas->setQml(qml, fileName); + canvas->setSource(QUrl::fromLocalFile(fileName)); QmlContext *ctxt = canvas->rootContext(); ctxt->addDefaultObject(this); diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml index ff00d83..18e8195 100644 --- a/demos/declarative/minehunt/minehunt.qml +++ b/demos/declarative/minehunt/minehunt.qml @@ -31,7 +31,7 @@ Item { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter source: "pics/flag.png" - opacity: modelData.hasFlag + opacity: model.hasFlag opacity: Behavior { NumberAnimation { property: "opacity" @@ -47,16 +47,16 @@ Item { Text { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - text: modelData.hint + text: model.hint color: "white" font.bold: true - opacity: !modelData.hasMine && modelData.hint > 0 + opacity: !model.hasMine && model.hint > 0 } Image { anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter source: "pics/bomb.png" - opacity: modelData.hasMine + opacity: model.hasMine } Explosion { id: expl @@ -65,7 +65,7 @@ Item { states: [ State { name: "back" - when: modelData.flipped + when: model.flipped PropertyChanges { target: flipable; angle: 180 } } ] @@ -81,7 +81,7 @@ Item { else ret = 0; if (ret > 0) { - if (modelData.hasMine && modelData.flipped) { + if (model.hasMine && model.flipped) { ret*3; } else { ret; @@ -93,10 +93,10 @@ Item { } NumberAnimation { easing: "easeInOutQuad" - matchProperties: "angle" + properties: "angle" } ScriptAction{ - script: if(modelData.hasMine && modelData.flipped){expl.explode = true;} + script: if(model.hasMine && model.flipped){expl.explode = true;} } } } diff --git a/demos/declarative/samegame/content/Dialog.qml b/demos/declarative/samegame/content/Dialog.qml index f9a281a..5bd1123 100644 --- a/demos/declarative/samegame/content/Dialog.qml +++ b/demos/declarative/samegame/content/Dialog.qml @@ -11,6 +11,7 @@ Rectangle { page.opacity = 1; } signal closed(); + property Item text: myText color: "white"; border.width: 1; width: myText.width + 20; height: myText.height + 40; opacity: 0 opacity: Behavior { diff --git a/demos/declarative/samegame/content/samegame.js b/demos/declarative/samegame/content/samegame.js index 0a42e88..c0f10bd 100755 --- a/demos/declarative/samegame/content/samegame.js +++ b/demos/declarative/samegame/content/samegame.js @@ -158,7 +158,11 @@ function victoryCheck() //Checks for game over if(deservesBonus || !(floodMoveCheck(0,maxY-1, -1))){ timer = new Date() - timer; + //scoreName.show("You won! Please enter your name: "); scoreName.show("You won! Please enter your name: "); + scoreName.initialWidth = scoreName.text.width + 20; + scoreName.width = scoreName.initialWidth; + scoreName.text.opacity = 0;//Just a spacer //dialog.show("Game Over. Your score is " + gameCanvas.score); } } @@ -218,8 +222,9 @@ function saveHighScore(name) { tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(name TEXT, score NUMBER, gridSize TEXT, time NUMBER)'); tx.executeSql(dataStr, data); - var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "12x17" ORDER BY score desc LIMIT 10'); - var r = "\nHIGH SCORES for a standard sized grid\n\n" + //Only show results for the current grid size + var rs = tx.executeSql('SELECT * FROM Scores WHERE gridSize = "'+maxX+"x"+maxY+'" ORDER BY score desc LIMIT 10'); + var r = "\nHIGH SCORES for this grid size\n\n" for(var i = 0; i < rs.rows.length; i++){ r += (i+1)+". " + rs.rows.item(i).name +' got ' + rs.rows.item(i).score + ' points in ' diff --git a/demos/declarative/samegame/samegame.qml b/demos/declarative/samegame/samegame.qml index 626c76b..f5c4fc5 100644 --- a/demos/declarative/samegame/samegame.qml +++ b/demos/declarative/samegame/samegame.qml @@ -38,20 +38,30 @@ Rectangle { Dialog { id: dialog; anchors.centerIn: parent; z: 21 } Dialog { id: scoreName; anchors.centerIn: parent; z: 22; + property int initialWidth: 0 + width: Behavior{NumberAnimation{} enabled: initialWidth!=0} Text { id: spacer - opacity: 0 - text: " You won! Please enter your name:" + anchors.left: scoreName.left + anchors.leftMargin: 20 + anchors.verticalCenter: parent.verticalCenter + text: "You won! Please enter your name: " } TextInput { id: editor + onTextChanged: { + var newWidth = editor.width + spacer.width + 40; + if((newWidth > scoreName.width && newWidth < screen.width) + || (scoreName.width > scoreName.initialWidth)) + scoreName.width = newWidth; + } onAccepted: { if(scoreName.opacity==1&&editor.text!="") saveHighScore(editor.text); scoreName.forceClose(); } anchors.verticalCenter: parent.verticalCenter - width: 72; focus: true + focus: true anchors.left: spacer.right } } @@ -79,7 +89,7 @@ Rectangle { text: "Score: " + gameCanvas.score; font.bold: true anchors.right: parent.right; anchors.rightMargin: 3 anchors.verticalCenter: parent.verticalCenter - color: activePalette.text + color: activePalette.windowText } } } diff --git a/demos/declarative/twitter/content/HomeTitleBar.qml b/demos/declarative/twitter/content/HomeTitleBar.qml index c48befd..8054f2e 100644 --- a/demos/declarative/twitter/content/HomeTitleBar.qml +++ b/demos/declarative/twitter/content/HomeTitleBar.qml @@ -115,7 +115,7 @@ Item { transitions: [ Transition { from: "*"; to: "*" - NumberAnimation { matchProperties: "x,y,width,height"; easing: "easeInOutQuad" } + NumberAnimation { properties: "x,y,width,height"; easing: "easeInOutQuad" } } ] } diff --git a/demos/declarative/twitter/content/Loading.qml b/demos/declarative/twitter/content/Loading.qml index 8b22e70..3151415 100644 --- a/demos/declarative/twitter/content/Loading.qml +++ b/demos/declarative/twitter/content/Loading.qml @@ -3,6 +3,6 @@ import Qt 4.6 Image { id: loading; source: "images/loading.png"; transformOrigin: "Center" rotation: NumberAnimation { - id: "RotationAnimation"; from: 0; to: 360; running: loading.visible == true; repeat: true; duration: 900 + from: 0; to: 360; running: loading.visible == true; repeat: true; duration: 900 } } diff --git a/demos/declarative/twitter/content/MultiTitleBar.qml b/demos/declarative/twitter/content/MultiTitleBar.qml index ef8a450..ef7de65 100644 --- a/demos/declarative/twitter/content/MultiTitleBar.qml +++ b/demos/declarative/twitter/content/MultiTitleBar.qml @@ -18,7 +18,7 @@ Item { } ] transitions: [ - Transition { NumberAnimation { matchProperties: "x,y"; duration: 500; easing: "easeInOutQuad" } } + Transition { NumberAnimation { properties: "x,y"; duration: 500; easing: "easeInOutQuad" } } ] } diff --git a/demos/declarative/twitter/content/TitleBar.qml b/demos/declarative/twitter/content/TitleBar.qml index 28e7389..42a6115 100644 --- a/demos/declarative/twitter/content/TitleBar.qml +++ b/demos/declarative/twitter/content/TitleBar.qml @@ -72,6 +72,6 @@ Item { } transitions: Transition { - NumberAnimation { matchProperties: "x"; easing: "easeInOutQuad" } + NumberAnimation { properties: "x"; easing: "easeInOutQuad" } } } diff --git a/demos/declarative/twitter/twitter.qml b/demos/declarative/twitter/twitter.qml index bb7da9c..d2abf28 100644 --- a/demos/declarative/twitter/twitter.qml +++ b/demos/declarative/twitter/twitter.qml @@ -89,7 +89,7 @@ Item { } ] transitions: [ - Transition { NumberAnimation { matchProperties: "x,y"; duration: 500; easing: "easeInOutQuad" } } + Transition { NumberAnimation { properties: "x,y"; duration: 500; easing: "easeInOutQuad" } } ] } } diff --git a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml index a7e6a97..e58ab0a 100644 --- a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml +++ b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml @@ -96,8 +96,8 @@ Image { transitions: [ Transition { NumberAnimation { - matchTargets: header - matchProperties: "progressOff" + targets: header + properties: "progressOff" easing: "easeInOutQuad" duration: 300 } diff --git a/demos/declarative/webbrowser/content/fieldtext/FieldText.qml b/demos/declarative/webbrowser/content/fieldtext/FieldText.qml index 6b1d271..b1c1938 100644 --- a/demos/declarative/webbrowser/content/fieldtext/FieldText.qml +++ b/demos/declarative/webbrowser/content/fieldtext/FieldText.qml @@ -149,7 +149,7 @@ Item { to: "*" reversible: true NumberAnimation { - matchProperties: "opacity,leftMargin,rightMargin" + properties: "opacity,leftMargin,rightMargin" duration: 200 } ColorAnimation { diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml index 3b3790c..8de13d5 100644 --- a/demos/declarative/webbrowser/webbrowser.qml +++ b/demos/declarative/webbrowser/webbrowser.qml @@ -97,7 +97,7 @@ Item { transitions: [ Transition { NumberAnimation { - matchProperties: "opacity" + properties: "opacity" easing: "easeInOutQuad" duration: 300 } @@ -153,7 +153,7 @@ Item { transitions: [ Transition { NumberAnimation { - matchProperties: "opacity" + properties: "opacity" easing: "easeInOutQuad" duration: 320 } |