From f5e3e21e95275a8cf31cddf2063dfa497e92872e Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 5 May 2010 16:22:51 +1000 Subject: Use enum rather than string for easing type. --- demos/declarative/calculator/calculator.qml | 4 +- demos/declarative/flickr/flickr.qml | 4 +- demos/declarative/flickr/mobile/GridDelegate.qml | 6 +- demos/declarative/flickr/mobile/ImageDetails.qml | 2 +- demos/declarative/flickr/mobile/TitleBar.qml | 2 +- demos/declarative/minehunt/MinehuntCore/Tile.qml | 2 +- .../photoviewer/PhotoViewerCore/AlbumDelegate.qml | 8 +- .../twitter/TwitterCore/HomeTitleBar.qml | 2 +- .../twitter/TwitterCore/MultiTitleBar.qml | 2 +- demos/declarative/twitter/TwitterCore/TitleBar.qml | 2 +- demos/declarative/twitter/twitter.qml | 2 +- .../content/RetractingWebBrowserHeader.qml | 2 +- demos/declarative/webbrowser/webbrowser.qml | 4 +- examples/declarative/animations/easing.qml | 104 +++++++++++---------- .../declarative/animations/property-animation.qml | 4 +- .../declarative/behaviors/behavior-example.qml | 4 +- .../border-image/content/MyBorderImage.qml | 20 +++- .../connections/connections-example.qml | 2 +- examples/declarative/focus/Core/ListViews.qml | 6 +- examples/declarative/focus/focus.qml | 4 +- examples/declarative/fonts/hello.qml | 2 +- examples/declarative/layouts/Button.qml | 42 ++++++--- examples/declarative/layouts/positioners.qml | 16 ++-- examples/declarative/parallax/qml/Smiley.qml | 4 +- examples/declarative/proxywidgets/proxywidgets.qml | 2 +- .../declarative/slideswitch/content/Switch.qml | 2 +- examples/declarative/states/transitions.qml | 4 +- .../declarative/tutorials/helloworld/tutorial3.qml | 2 +- examples/declarative/xmldata/yahoonews.qml | 2 +- .../graphicsitems/qdeclarativegridview.cpp | 2 +- .../graphicsitems/qdeclarativelistview.cpp | 2 +- .../graphicsitems/qdeclarativepositioners.cpp | 2 +- src/declarative/util/qdeclarativeanimation.cpp | 2 +- src/declarative/util/qdeclarativebehavior.cpp | 2 +- src/declarative/util/qdeclarativespringfollow.cpp | 2 +- 35 files changed, 154 insertions(+), 120 deletions(-) diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml index 286a4d1..75f5735 100644 --- a/demos/declarative/calculator/calculator.qml +++ b/demos/declarative/calculator/calculator.qml @@ -98,8 +98,8 @@ Rectangle { transitions: Transition { SequentialAnimation { PropertyAction { target: rotateButton; property: "operation" } - NumberAnimation { properties: "rotation"; duration: 300; easing.type: "InOutQuint" } - NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: "InOutQuint" } + NumberAnimation { properties: "rotation"; duration: 300; easing.type: Easing.InOutQuint } + NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint } } } } diff --git a/demos/declarative/flickr/flickr.qml b/demos/declarative/flickr/flickr.qml index 8b73beb..29763d4 100644 --- a/demos/declarative/flickr/flickr.qml +++ b/demos/declarative/flickr/flickr.qml @@ -38,7 +38,7 @@ Item { } transitions: Transition { - NumberAnimation { properties: "x"; duration: 500; easing.type: "InOutQuad" } + NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad } } } @@ -76,7 +76,7 @@ Item { } transitions: Transition { - NumberAnimation { properties: "x"; duration: 500; easing.type: "InOutQuad" } + NumberAnimation { properties: "x"; duration: 500; easing.type: Easing.InOutQuad } } } } diff --git a/demos/declarative/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/mobile/GridDelegate.qml index 5ab7b87..eccdc34 100644 --- a/demos/declarative/flickr/mobile/GridDelegate.qml +++ b/demos/declarative/flickr/mobile/GridDelegate.qml @@ -21,7 +21,7 @@ Item { anchors.centerIn: parent scale: 0.0 - Behavior on scale { NumberAnimation { easing.type: "InOutQuad"} } + Behavior on scale { NumberAnimation { easing.type: Easing.InOutQuad} } id: scaleMe Rectangle { height: 79; width: 79; id: blackRect; anchors.centerIn: parent; color: "black"; smooth: true } @@ -53,14 +53,14 @@ Transition { from: "Show"; to: "Details" ParentAnimation { - NumberAnimation { properties: "x,y"; duration: 500; easing.type: "InOutQuad" } + NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } } }, Transition { from: "Details"; to: "Show" SequentialAnimation { ParentAnimation { - NumberAnimation { properties: "x,y"; duration: 500; easing.type: "InOutQuad" } + NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } } PropertyAction { targets: wrapper; properties: "z" } } diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml index 58b0b83..310c9df 100644 --- a/demos/declarative/flickr/mobile/ImageDetails.qml +++ b/demos/declarative/flickr/mobile/ImageDetails.qml @@ -114,7 +114,7 @@ Flipable { transitions: Transition { SequentialAnimation { PropertyAction { target: bigImage; property: "smooth"; value: false } - NumberAnimation { easing.type: "InOutQuad"; properties: "angle"; duration: 500 } + NumberAnimation { easing.type: Easing.InOutQuad; 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 bb57429..025b897 100644 --- a/demos/declarative/flickr/mobile/TitleBar.qml +++ b/demos/declarative/flickr/mobile/TitleBar.qml @@ -81,6 +81,6 @@ Item { } transitions: Transition { - NumberAnimation { properties: "x"; easing.type: "InOutQuad" } + NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad } } } diff --git a/demos/declarative/minehunt/MinehuntCore/Tile.qml b/demos/declarative/minehunt/MinehuntCore/Tile.qml index f3620f4..98b2017 100644 --- a/demos/declarative/minehunt/MinehuntCore/Tile.qml +++ b/demos/declarative/minehunt/MinehuntCore/Tile.qml @@ -57,7 +57,7 @@ Flipable { PauseAnimation { duration: pauseDur } - RotationAnimation { easing.type: "InOutQuad" } + RotationAnimation { easing.type: Easing.InOutQuad } ScriptAction { script: if (modelData.hasMine && modelData.flipped) { expl.explode = true } } } } diff --git a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml index d39b7bc..142735f 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml @@ -78,11 +78,11 @@ Component { ] GridView.onAdd: NumberAnimation { - target: albumWrapper; properties: "scale"; from: 0.0; to: 1.0; easing.type: "OutQuad" + target: albumWrapper; properties: "scale"; from: 0.0; to: 1.0; easing.type: Easing.OutQuad } GridView.onRemove: SequentialAnimation { PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: true } - NumberAnimation { target: albumWrapper; property: "scale"; from: 1.0; to: 0.0; easing.type: "OutQuad" } + NumberAnimation { target: albumWrapper; property: "scale"; from: 1.0; to: 0.0; easing.type: Easing.OutQuad } PropertyAction { target: albumWrapper; property: "GridView.delayRemove"; value: false } } @@ -92,12 +92,12 @@ Component { SequentialAnimation { NumberAnimation { properties: 'opacity'; duration: 250 } PauseAnimation { duration: 350 } - NumberAnimation { target: backButton; properties: "y"; duration: 200; easing.type: "OutQuad" } + NumberAnimation { target: backButton; properties: "y"; duration: 200; easing.type: Easing.OutQuad } } }, Transition { from: 'inGrid'; to: '*' - NumberAnimation { properties: "y,opacity"; easing.type: "OutQuad"; duration: 300 } + NumberAnimation { properties: "y,opacity"; easing.type: Easing.OutQuad; duration: 300 } } ] } diff --git a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml index c1ae3e5..11aa74f 100644 --- a/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/HomeTitleBar.qml @@ -113,7 +113,7 @@ Item { transitions: [ Transition { from: "*"; to: "*" - NumberAnimation { properties: "x,y,width,height"; easing.type: "InOutQuad" } + NumberAnimation { properties: "x,y,width,height"; easing.type: Easing.InOutQuad } } ] } diff --git a/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml b/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml index 8c27e2b..445eda4 100644 --- a/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/MultiTitleBar.qml @@ -18,7 +18,7 @@ Item { } ] transitions: [ - Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: "InOutQuad" } } + Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } } ] } diff --git a/demos/declarative/twitter/TwitterCore/TitleBar.qml b/demos/declarative/twitter/TwitterCore/TitleBar.qml index 87ceec5..5256de4 100644 --- a/demos/declarative/twitter/TwitterCore/TitleBar.qml +++ b/demos/declarative/twitter/TwitterCore/TitleBar.qml @@ -70,6 +70,6 @@ Item { } transitions: Transition { - NumberAnimation { properties: "x"; easing.type: "InOutQuad" } + NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad } } } diff --git a/demos/declarative/twitter/twitter.qml b/demos/declarative/twitter/twitter.qml index 0e3ec3e..f86388e 100644 --- a/demos/declarative/twitter/twitter.qml +++ b/demos/declarative/twitter/twitter.qml @@ -88,7 +88,7 @@ Item { } ] transitions: [ - Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: "InOutQuad" } } + Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } } ] } } diff --git a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml index f5bfadf..b02a5bf 100644 --- a/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml +++ b/demos/declarative/webbrowser/content/RetractingWebBrowserHeader.qml @@ -105,7 +105,7 @@ Image { NumberAnimation { targets: header properties: "progressOff" - easing.type: "InOutQuad" + easing.type: Easing.InOutQuad duration: 300 } } diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml index fbbe7b2..f1a6034 100644 --- a/demos/declarative/webbrowser/webbrowser.qml +++ b/demos/declarative/webbrowser/webbrowser.qml @@ -99,7 +99,7 @@ Item { Transition { NumberAnimation { properties: "opacity" - easing.type: "InOutQuad" + easing.type: Easing.InOutQuad duration: 300 } } @@ -155,7 +155,7 @@ Item { Transition { NumberAnimation { properties: "opacity" - easing.type: "InOutQuad" + easing.type: Easing.InOutQuad duration: 320 } } diff --git a/examples/declarative/animations/easing.qml b/examples/declarative/animations/easing.qml index b0f9669..939d43b 100644 --- a/examples/declarative/animations/easing.qml +++ b/examples/declarative/animations/easing.qml @@ -6,47 +6,47 @@ Rectangle { ListModel { id: easingTypes - ListElement { type: "Linear"; ballColor: "DarkRed" } - ListElement { type: "InQuad"; ballColor: "IndianRed" } - ListElement { type: "OutQuad"; ballColor: "Salmon" } - ListElement { type: "InOutQuad"; ballColor: "Tomato" } - ListElement { type: "OutInQuad"; ballColor: "DarkOrange" } - ListElement { type: "InCubic"; ballColor: "Gold" } - ListElement { type: "OutCubic"; ballColor: "Yellow" } - ListElement { type: "InOutCubic"; ballColor: "PeachPuff" } - ListElement { type: "OutInCubic"; ballColor: "Thistle" } - ListElement { type: "InQuart"; ballColor: "Orchid" } - ListElement { type: "OutQuart"; ballColor: "Purple" } - ListElement { type: "InOutQuart"; ballColor: "SlateBlue" } - ListElement { type: "OutInQuart"; ballColor: "Chartreuse" } - ListElement { type: "InQuint"; ballColor: "LimeGreen" } - ListElement { type: "OutQuint"; ballColor: "SeaGreen" } - ListElement { type: "InOutQuint"; ballColor: "DarkGreen" } - ListElement { type: "OutInQuint"; ballColor: "Olive" } - ListElement { type: "InSine"; ballColor: "DarkSeaGreen" } - ListElement { type: "OutSine"; ballColor: "Teal" } - ListElement { type: "InOutSine"; ballColor: "Turquoise" } - ListElement { type: "OutInSine"; ballColor: "SteelBlue" } - ListElement { type: "InExpo"; ballColor: "SkyBlue" } - ListElement { type: "OutExpo"; ballColor: "RoyalBlue" } - ListElement { type: "InOutExpo"; ballColor: "MediumBlue" } - ListElement { type: "OutInExpo"; ballColor: "MidnightBlue" } - ListElement { type: "InCirc"; ballColor: "CornSilk" } - ListElement { type: "OutCirc"; ballColor: "Bisque" } - ListElement { type: "InOutCirc"; ballColor: "RosyBrown" } - ListElement { type: "OutInCirc"; ballColor: "SandyBrown" } - ListElement { type: "InElastic"; ballColor: "DarkGoldenRod" } - ListElement { type: "OutElastic"; ballColor: "Chocolate" } - ListElement { type: "InOutElastic"; ballColor: "SaddleBrown" } - ListElement { type: "OutInElastic"; ballColor: "Brown" } - ListElement { type: "InBack"; ballColor: "Maroon" } - ListElement { type: "OutBack"; ballColor: "LavenderBlush" } - ListElement { type: "InOutBack"; ballColor: "MistyRose" } - ListElement { type: "OutInBack"; ballColor: "Gainsboro" } - ListElement { type: "OutBounce"; ballColor: "Silver" } - ListElement { type: "InBounce"; ballColor: "DimGray" } - ListElement { type: "InOutBounce"; ballColor: "SlateGray" } - ListElement { type: "OutInBounce"; ballColor: "DarkSlateGray" } + ListElement { name: "Easing.Linear"; type: Easing.Linear; ballColor: "DarkRed" } + ListElement { name: "Easing.InQuad"; type: Easing.InQuad; ballColor: "IndianRed" } + ListElement { name: "Easing.OutQuad"; type: Easing.OutQuad; ballColor: "Salmon" } + ListElement { name: "Easing.InOutQuad"; type: Easing.InOutQuad; ballColor: "Tomato" } + ListElement { name: "Easing.OutInQuad"; type: Easing.OutInQuad; ballColor: "DarkOrange" } + ListElement { name: "Easing.InCubic"; type: Easing.InCubic; ballColor: "Gold" } + ListElement { name: "Easing.OutCubic"; type: Easing.OutCubic; ballColor: "Yellow" } + ListElement { name: "Easing.InOutCubic"; type: Easing.InOutCubic; ballColor: "PeachPuff" } + ListElement { name: "Easing.OutInCubic"; type: Easing.OutInCubic; ballColor: "Thistle" } + ListElement { name: "Easing.InQuart"; type: Easing.InQuart; ballColor: "Orchid" } + ListElement { name: "Easing.OutQuart"; type: Easing.OutQuart; ballColor: "Purple" } + ListElement { name: "Easing.InOutQuart"; type: Easing.InOutQuart; ballColor: "SlateBlue" } + ListElement { name: "Easing.OutInQuart"; type: Easing.OutInQuart; ballColor: "Chartreuse" } + ListElement { name: "Easing.InQuint"; type: Easing.InQuint; ballColor: "LimeGreen" } + ListElement { name: "Easing.OutQuint"; type: Easing.OutQuint; ballColor: "SeaGreen" } + ListElement { name: "Easing.InOutQuint"; type: Easing.InOutQuint; ballColor: "DarkGreen" } + ListElement { name: "Easing.OutInQuint"; type: Easing.OutInQuint; ballColor: "Olive" } + ListElement { name: "Easing.InSine"; type: Easing.InSine; ballColor: "DarkSeaGreen" } + ListElement { name: "Easing.OutSine"; type: Easing.OutSine; ballColor: "Teal" } + ListElement { name: "Easing.InOutSine"; type: Easing.InOutSine; ballColor: "Turquoise" } + ListElement { name: "Easing.OutInSine"; type: Easing.OutInSine; ballColor: "SteelBlue" } + ListElement { name: "Easing.InExpo"; type: Easing.InExpo; ballColor: "SkyBlue" } + ListElement { name: "Easing.OutExpo"; type: Easing.OutExpo; ballColor: "RoyalBlue" } + ListElement { name: "Easing.InOutExpo"; type: Easing.InOutExpo; ballColor: "MediumBlue" } + ListElement { name: "Easing.OutInExpo"; type: Easing.OutInExpo; ballColor: "MidnightBlue" } + ListElement { name: "Easing.InCirc"; type: Easing.InCirc; ballColor: "CornSilk" } + ListElement { name: "Easing.OutCirc"; type: Easing.OutCirc; ballColor: "Bisque" } + ListElement { name: "Easing.InOutCirc"; type: Easing.InOutCirc; ballColor: "RosyBrown" } + ListElement { name: "Easing.OutInCirc"; type: Easing.OutInCirc; ballColor: "SandyBrown" } + ListElement { name: "Easing.InElastic"; type: Easing.InElastic; ballColor: "DarkGoldenRod" } + ListElement { name: "Easing.InElastic"; type: Easing.OutElastic; ballColor: "Chocolate" } + ListElement { name: "Easing.InOutElastic"; type: Easing.InOutElastic; ballColor: "SaddleBrown" } + ListElement { name: "Easing.OutInElastic"; type: Easing.OutInElastic; ballColor: "Brown" } + ListElement { name: "Easing.InBack"; type: Easing.InBack; ballColor: "Maroon" } + ListElement { name: "Easing.OutBack"; type: Easing.OutBack; ballColor: "LavenderBlush" } + ListElement { name: "Easing.InOutBack"; type: Easing.InOutBack; ballColor: "MistyRose" } + ListElement { name: "Easing.OutInBack"; type: Easing.OutInBack; ballColor: "Gainsboro" } + ListElement { name: "Easing.OutBounce"; type: Easing.OutBounce; ballColor: "Silver" } + ListElement { name: "Easing.InBounce"; type: Easing.InBounce; ballColor: "DimGray" } + ListElement { name: "Easing.InOutBounce"; type: Easing.InOutBounce; ballColor: "SlateGray" } + ListElement { name: "Easing.OutInBounce"; type: Easing.OutInBounce; ballColor: "DarkSlateGray" } } Component { @@ -54,19 +54,26 @@ Rectangle { Item { height: 42; width: window.width - Text { text: type; anchors.centerIn: parent; color: "White" } + + Text { text: name; anchors.centerIn: parent; color: "White" } + Rectangle { id: slot1; color: "#121212"; x: 30; height: 32; width: 32 - border.color: "#343434"; border.width: 1; radius: 8; anchors.verticalCenter: parent.verticalCenter + border.color: "#343434"; border.width: 1; radius: 8 + anchors.verticalCenter: parent.verticalCenter } + Rectangle { id: slot2; color: "#121212"; x: window.width - 62; height: 32; width: 32 - border.color: "#343434"; border.width: 1; radius: 8; anchors.verticalCenter: parent.verticalCenter + border.color: "#343434"; border.width: 1; radius: 8 + anchors.verticalCenter: parent.verticalCenter } + Rectangle { id: rect; x: 30; color: "#454545" border.color: "White"; border.width: 2 - height: 32; width: 32; radius: 8; anchors.verticalCenter: parent.verticalCenter + height: 32; width: 32; radius: 8 + anchors.verticalCenter: parent.verticalCenter MouseArea { onClicked: if (rect.state == '') rect.state = "right"; else rect.state = '' @@ -79,10 +86,8 @@ Rectangle { } transitions: Transition { - // ParallelAnimation { - NumberAnimation { properties: "x"; easing.type: type; duration: 1000 } - ColorAnimation { properties: "color"; easing.type: type; duration: 1000 } - // } + NumberAnimation { properties: "x"; easing.type: type; duration: 1000 } + ColorAnimation { properties: "color"; easing.type: type; duration: 1000 } } } } @@ -90,6 +95,7 @@ Rectangle { Flickable { anchors.fill: parent; contentHeight: layout.height + Column { id: layout anchors.left: parent.left; anchors.right: parent.right diff --git a/examples/declarative/animations/property-animation.qml b/examples/declarative/animations/property-animation.qml index 5afe8ef..6360511 100644 --- a/examples/declarative/animations/property-animation.qml +++ b/examples/declarative/animations/property-animation.qml @@ -48,13 +48,13 @@ Item { // Move from minHeight to maxHeight in 300ms, using the OutExpo easing function NumberAnimation { from: smiley.minHeight; to: smiley.maxHeight - easing.type: "OutExpo"; duration: 300 + easing.type: Easing.OutExpo; duration: 300 } // Then move back to minHeight in 1 second, using the OutBounce easing function NumberAnimation { from: smiley.maxHeight; to: smiley.minHeight - easing.type: "OutBounce"; duration: 1000 + easing.type: Easing.OutBounce; duration: 1000 } // Then pause for 500ms diff --git a/examples/declarative/behaviors/behavior-example.qml b/examples/declarative/behaviors/behavior-example.qml index b7bae6c..1f17b81 100644 --- a/examples/declarative/behaviors/behavior-example.qml +++ b/examples/declarative/behaviors/behavior-example.qml @@ -49,12 +49,12 @@ Rectangle { // Setting an 'elastic' behavior on the focusRect's x property. Behavior on x { - NumberAnimation { easing.type: "OutElastic"; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 } + NumberAnimation { easing.type: Easing.OutElastic; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 } } // Setting an 'elastic' behavior on the focusRect's y property. Behavior on y { - NumberAnimation { easing.type: "OutElastic"; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 } + NumberAnimation { easing.type: Easing.OutElastic; easing.amplitude: 3.0; easing.period: 2.0; duration: 300 } } Text { diff --git a/examples/declarative/border-image/content/MyBorderImage.qml b/examples/declarative/border-image/content/MyBorderImage.qml index 2573a14..b47df7b 100644 --- a/examples/declarative/border-image/content/MyBorderImage.qml +++ b/examples/declarative/border-image/content/MyBorderImage.qml @@ -20,14 +20,26 @@ Item { SequentialAnimation on width { loops: Animation.Infinite - NumberAnimation { from: container.minWidth; to: container.maxWidth; duration: 2000; easing.type: "InOutQuad"} - NumberAnimation { from: container.maxWidth; to: container.minWidth; duration: 2000; easing.type: "InOutQuad" } + NumberAnimation { + from: container.minWidth; to: container.maxWidth + duration: 2000; easing.type: Easing.InOutQuad + } + NumberAnimation { + from: container.maxWidth; to: container.minWidth + duration: 2000; easing.type: Easing.InOutQuad + } } SequentialAnimation on height { loops: Animation.Infinite - NumberAnimation { from: container.minHeight; to: container.maxHeight; duration: 2000; easing.type: "InOutQuad"} - NumberAnimation { from: container.maxHeight; to: container.minHeight; duration: 2000; easing.type: "InOutQuad" } + NumberAnimation { + from: container.minHeight; to: container.maxHeight + duration: 2000; easing.type: Easing.InOutQuad + } + NumberAnimation { + from: container.maxHeight; to: container.minHeight + duration: 2000; easing.type: Easing.InOutQuad + } } border.top: container.margin diff --git a/examples/declarative/connections/connections-example.qml b/examples/declarative/connections/connections-example.qml index fbef968..1dd10ab 100644 --- a/examples/declarative/connections/connections-example.qml +++ b/examples/declarative/connections/connections-example.qml @@ -17,7 +17,7 @@ Rectangle { rotation: window.angle Behavior on rotation { - NumberAnimation { easing.type: "OutCubic"; duration: 300 } + NumberAnimation { easing.type: Easing.OutCubic; duration: 300 } } } diff --git a/examples/declarative/focus/Core/ListViews.qml b/examples/declarative/focus/Core/ListViews.qml index 089f821..32a5d4c 100644 --- a/examples/declarative/focus/Core/ListViews.qml +++ b/examples/declarative/focus/Core/ListViews.qml @@ -14,7 +14,7 @@ FocusScope { delegate: ListViewDelegate {} Behavior on y { - NumberAnimation { duration: 600; easing.type: "OutQuint" } + NumberAnimation { duration: 600; easing.type: Easing.OutQuint } } } @@ -26,7 +26,7 @@ FocusScope { delegate: ListViewDelegate {} Behavior on y { - NumberAnimation { duration: 600; easing.type: "OutQuint" } + NumberAnimation { duration: 600; easing.type: Easing.OutQuint } } } @@ -38,7 +38,7 @@ FocusScope { delegate: ListViewDelegate {} Behavior on y { - NumberAnimation { duration: 600; easing.type: "OutQuint" } + NumberAnimation { duration: 600; easing.type: Easing.OutQuint } } } diff --git a/examples/declarative/focus/focus.qml b/examples/declarative/focus/focus.qml index 22b0e50..8c992ae 100644 --- a/examples/declarative/focus/focus.qml +++ b/examples/declarative/focus/focus.qml @@ -38,7 +38,7 @@ Rectangle { } transitions: Transition { - NumberAnimation { properties: "y"; duration: 600; easing.type: "OutQuint" } + NumberAnimation { properties: "y"; duration: 600; easing.type: Easing.OutQuint } } } @@ -64,6 +64,6 @@ Rectangle { } transitions: Transition { - NumberAnimation { properties: "x,opacity"; duration: 600; easing.type: "OutQuint" } + NumberAnimation { properties: "x,opacity"; duration: 600; easing.type: Easing.OutQuint } } } diff --git a/examples/declarative/fonts/hello.qml b/examples/declarative/fonts/hello.qml index d4d0e4c..0d6f4cd 100644 --- a/examples/declarative/fonts/hello.qml +++ b/examples/declarative/fonts/hello.qml @@ -19,7 +19,7 @@ Rectangle { SequentialAnimation on font.letterSpacing { loops: Animation.Infinite; - NumberAnimation { from: 100; to: 300; easing.type: "InQuad"; duration: 3000 } + NumberAnimation { from: 100; to: 300; easing.type: Easing.InQuad; duration: 3000 } ScriptAction { script: { container.y = (screen.height / 4) + (Math.random() * screen.height / 2) diff --git a/examples/declarative/layouts/Button.qml b/examples/declarative/layouts/Button.qml index 0f08893..d03eeb5 100644 --- a/examples/declarative/layouts/Button.qml +++ b/examples/declarative/layouts/Button.qml @@ -1,22 +1,38 @@ import Qt 4.7 -Rectangle { border.color: "black"; color: "steelblue"; radius: 5; width: pix.width + textelement.width + 13; height: pix.height + 10; id: page +Rectangle { + id: page + property string text property string icon signal clicked - Image { id: pix; x: 5; y:5; source: parent.icon} - Text { id: textelement; text: page.text; color: "white"; x:pix.width+pix.x+3; anchors.verticalCenter: pix.verticalCenter;} - MouseArea{ id:mr; anchors.fill: parent; onClicked: {parent.focus = true; page.clicked()}} + border.color: "black"; color: "steelblue"; radius: 5 + width: pix.width + textelement.width + 13 + height: pix.height + 10 + + Image { id: pix; x: 5; y:5; source: parent.icon } + + Text { + id: textelement + text: page.text; color: "white" + x: pix.width + pix.x + 3 + anchors.verticalCenter: pix.verticalCenter + } + + MouseArea { + id: mr + anchors.fill: parent + onClicked: { parent.focus = true; page.clicked() } + } - states: - State{ name:"pressed"; when:mr.pressed - PropertyChanges {target:textelement; x: 5} - PropertyChanges {target:pix; x:textelement.x+textelement.width + 3} - } + states: State { + name: "pressed"; when: mr.pressed + PropertyChanges { target: textelement; x: 5 } + PropertyChanges { target: pix; x: textelement.x + textelement.width + 3 } + } - transitions: - Transition{ - NumberAnimation { properties:"x,left"; easing.type:"InOutQuad"; duration:200 } - } + transitions: Transition { + NumberAnimation { properties: "x,left"; easing.type: Easing.InOutQuad; duration: 200 } + } } diff --git a/examples/declarative/layouts/positioners.qml b/examples/declarative/layouts/positioners.qml index 3703b59..2cb0b8b 100644 --- a/examples/declarative/layouts/positioners.qml +++ b/examples/declarative/layouts/positioners.qml @@ -8,10 +8,10 @@ Rectangle { id: layout1 y: 0 move: Transition { - NumberAnimation { properties: "y"; easing.type: "OutBounce" } + NumberAnimation { properties: "y"; easing.type: Easing.OutBounce } } add: Transition { - NumberAnimation { properties: "y"; easing.type: "OutQuad" } + NumberAnimation { properties: "y"; easing.type: Easing.OutQuad } } Rectangle { color: "red"; width: 100; height: 50; border.color: "black"; radius: 15 } @@ -43,10 +43,10 @@ Rectangle { id: layout2 y: 300 move: Transition { - NumberAnimation { properties: "x"; easing.type: "OutBounce" } + NumberAnimation { properties: "x"; easing.type: Easing.OutBounce } } add: Transition { - NumberAnimation { properties: "x"; easing.type: "OutQuad" } + NumberAnimation { properties: "x"; easing.type: Easing.OutQuad } } Rectangle { color: "red"; width: 50; height: 100; border.color: "black"; radius: 15 } @@ -117,11 +117,11 @@ Rectangle { columns: 3 move: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce } } add: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce } } Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 } @@ -167,11 +167,11 @@ Rectangle { x: 260; y: 250; width: 150 move: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce } } add: Transition { - NumberAnimation { properties: "x,y"; easing.type: "OutBounce" } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce } } Rectangle { color: "red"; width: 50; height: 50; border.color: "black"; radius: 15 } diff --git a/examples/declarative/parallax/qml/Smiley.qml b/examples/declarative/parallax/qml/Smiley.qml index b1e1ae8..cfa4fed 100644 --- a/examples/declarative/parallax/qml/Smiley.qml +++ b/examples/declarative/parallax/qml/Smiley.qml @@ -30,13 +30,13 @@ Item { // Move from minHeight to maxHeight in 300ms, using the OutExpo easing function NumberAnimation { from: smiley.minHeight; to: smiley.maxHeight - easing.type: "OutExpo"; duration: 300 + easing.type: Easing.OutExpo; duration: 300 } // Then move back to minHeight in 1 second, using the OutBounce easing function NumberAnimation { from: smiley.maxHeight; to: smiley.minHeight - easing.type: "OutBounce"; duration: 1000 + easing.type: Easing.OutBounce; duration: 1000 } // Then pause for 500ms diff --git a/examples/declarative/proxywidgets/proxywidgets.qml b/examples/declarative/proxywidgets/proxywidgets.qml index 46dcf99..88de37f 100644 --- a/examples/declarative/proxywidgets/proxywidgets.qml +++ b/examples/declarative/proxywidgets/proxywidgets.qml @@ -63,7 +63,7 @@ Rectangle { transitions: Transition { ParallelAnimation { - NumberAnimation { properties: "x,y,rotation"; duration: 600; easing.type: "OutQuad" } + NumberAnimation { properties: "x,y,rotation"; duration: 600; easing.type: Easing.OutQuad } ColorAnimation { target: window; duration: 600 } } } diff --git a/examples/declarative/slideswitch/content/Switch.qml b/examples/declarative/slideswitch/content/Switch.qml index a8fa6ef..1aa7696 100644 --- a/examples/declarative/slideswitch/content/Switch.qml +++ b/examples/declarative/slideswitch/content/Switch.qml @@ -69,7 +69,7 @@ Item { //![7] transitions: Transition { - NumberAnimation { properties: "x"; easing.type: "InOutQuad"; duration: 200 } + NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad; duration: 200 } } //![7] } diff --git a/examples/declarative/states/transitions.qml b/examples/declarative/states/transitions.qml index d1b1dd6..ccc7060 100644 --- a/examples/declarative/states/transitions.qml +++ b/examples/declarative/states/transitions.qml @@ -72,14 +72,14 @@ Rectangle { // with OutBounce easing function. Transition { from: "*"; to: "middleRight" - NumberAnimation { properties: "x,y"; easing.type: "OutBounce"; duration: 1000 } + NumberAnimation { properties: "x,y"; easing.type: Easing.OutBounce; duration: 1000 } }, // When transitioning to 'bottomLeft' move x,y over a duration of 2 seconds, // with InOutQuad easing function. Transition { from: "*"; to: "bottomLeft" - NumberAnimation { properties: "x,y"; easing.type: "InOutQuad"; duration: 2000 } + NumberAnimation { properties: "x,y"; easing.type: Easing.InOutQuad; duration: 2000 } }, // For any other state changes move x,y linearly over duration of 200ms. diff --git a/examples/declarative/tutorials/helloworld/tutorial3.qml b/examples/declarative/tutorials/helloworld/tutorial3.qml index 041d9a9..0da762c 100644 --- a/examples/declarative/tutorials/helloworld/tutorial3.qml +++ b/examples/declarative/tutorials/helloworld/tutorial3.qml @@ -28,7 +28,7 @@ Rectangle { transitions: Transition { from: ""; to: "down"; reversible: true ParallelAnimation { - NumberAnimation { properties: "y,rotation"; duration: 500; easing.type: "InOutQuad" } + NumberAnimation { properties: "y,rotation"; duration: 500; easing.type: Easing.InOutQuad } ColorAnimation { duration: 500 } } } diff --git a/examples/declarative/xmldata/yahoonews.qml b/examples/declarative/xmldata/yahoonews.qml index 668778e..5bab463 100644 --- a/examples/declarative/xmldata/yahoonews.qml +++ b/examples/declarative/xmldata/yahoonews.qml @@ -65,7 +65,7 @@ Rectangle { transitions: Transition { from: "*"; to: "Details"; reversible: true SequentialAnimation { - NumberAnimation { duration: 200; properties: "height"; easing.type: "OutQuad" } + NumberAnimation { duration: 200; properties: "height"; easing.type: Easing.OutQuad } NumberAnimation { duration: 200; properties: "opacity" } } } diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 4c72482..9ae7279 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -964,7 +964,7 @@ QDeclarativeGridView::~QDeclarativeGridView() id: wrapper GridView.onRemove: SequentialAnimation { PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: true } - NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: "InOutQuad" } + NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad } PropertyAction { target: wrapper; property: "GridView.delayRemove"; value: false } } } diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 3877fab..cef7e18 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1395,7 +1395,7 @@ QDeclarativeListView::~QDeclarativeListView() id: wrapper ListView.onRemove: SequentialAnimation { PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true } - NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: "InOutQuad" } + NumberAnimation { target: wrapper; property: "scale"; to: 0; duration: 250; easing.type: Easing.InOutQuad } PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: false } } } diff --git a/src/declarative/graphicsitems/qdeclarativepositioners.cpp b/src/declarative/graphicsitems/qdeclarativepositioners.cpp index 206b09d..93bff3e 100644 --- a/src/declarative/graphicsitems/qdeclarativepositioners.cpp +++ b/src/declarative/graphicsitems/qdeclarativepositioners.cpp @@ -377,7 +377,7 @@ Column { move: Transition { NumberAnimation { properties: "y" - easing.type: "OutBounce" + easing.type: Easing.OutBounce } } } diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index 9f95348..7f4d2e4 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -1615,7 +1615,7 @@ void QDeclarativePropertyAnimationPrivate::convertVariant(QVariant &variant, int Animate any objects that have changed their x or y properties in the target state using an InOutQuad easing curve: \qml - Transition { PropertyAnimation { properties: "x,y"; easing.type: "InOutQuad" } } + Transition { PropertyAnimation { properties: "x,y"; easing.type: Easing.InOutQuad } } \endqml \o In a Behavior diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp index 90344ab..ba90007 100644 --- a/src/declarative/util/qdeclarativebehavior.cpp +++ b/src/declarative/util/qdeclarativebehavior.cpp @@ -82,7 +82,7 @@ public: y: 200 // initial value Behavior on y { NumberAnimation { - easing.type: "OutBounce" + easing.type: Easing.OutBounce easing.amplitude: 100 duration: 200 } diff --git a/src/declarative/util/qdeclarativespringfollow.cpp b/src/declarative/util/qdeclarativespringfollow.cpp index 70077f3..aae66ac 100644 --- a/src/declarative/util/qdeclarativespringfollow.cpp +++ b/src/declarative/util/qdeclarativespringfollow.cpp @@ -227,7 +227,7 @@ void QDeclarativeSpringFollowPrivate::stop() loops: Animation.Infinite NumberAnimation { to: 200 - easing.type: "OutBounce" + easing.type: Easing.OutBounce easing.amplitude: 100 duration: 2000 } -- cgit v0.12