aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/animation
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2019-11-28 09:54:06 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-11-28 12:43:01 +0000
commit22a0bf15c6e10958bfc5126fa15be066f0afb20f (patch)
treee1ea68f5d83886272e988258247c25b336403d8f /examples/quick/animation
parentc83ab72c82f5257eb81b9c2fb1c70ca93e21401f (diff)
examples/quick/animation/easing: Fix some linter warnings
Now explicitly importing QtQml and QtQml.Models. The example also utilizes required properties now. Change-Id: I819b03c0a0dc892683e680fee47a632f1e5b543a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples/quick/animation')
-rw-r--r--examples/quick/animation/easing/easing.qml29
1 files changed, 25 insertions, 4 deletions
diff --git a/examples/quick/animation/easing/easing.qml b/examples/quick/animation/easing/easing.qml
index 6db5599a66..f443486141 100644
--- a/examples/quick/animation/easing/easing.qml
+++ b/examples/quick/animation/easing/easing.qml
@@ -48,6 +48,8 @@
**
****************************************************************************/
+import QtQml 2.15
+import QtQml.Models 2.15
import QtQuick 2.0
Rectangle {
@@ -107,9 +109,14 @@ Rectangle {
id: delegate
Item {
+ id: delegateInstance
+ required property string name;
+ required property int type;
+ required property color ballColor;
+
height: 56; width: window.width
- Text { text: name; anchors.centerIn: parent; color: "White" }
+ Text { text: parent.name; anchors.centerIn: parent; color: "White" }
Rectangle {
id: slot1; color: "#121212"; x: 30; height: 46; width: 46
@@ -137,12 +144,26 @@ Rectangle {
states : State {
name: "right"
- PropertyChanges { target: rect; x: window.width - 76; color: ballColor }
+ PropertyChanges {
+ target: rect;
+ x: window.width - 76;
+ color: delegateInstance.ballColor
+ }
}
transitions: Transition {
- NumberAnimation { properties: "x"; easing.type: type; easing.bezierCurve: getBezierCurve(name); duration: 1000 }
- ColorAnimation { properties: "color"; easing.type: type; easing.bezierCurve: getBezierCurve(name); duration: 1000 }
+ NumberAnimation {
+ properties: "x"
+ easing.type: delegateInstance.type
+ easing.bezierCurve: window.getBezierCurve(delegateInstance.name)
+ duration: 1000
+ }
+ ColorAnimation {
+ properties: "color"
+ easing.type: delegateInstance.type
+ easing.bezierCurve: window.getBezierCurve(delegateInstance.name)
+ duration: 1000
+ }
}
}
}