From 22a0bf15c6e10958bfc5126fa15be066f0afb20f Mon Sep 17 00:00:00 2001 From: Maximilian Goldstein Date: Thu, 28 Nov 2019 09:54:06 +0100 Subject: 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 --- examples/quick/animation/easing/easing.qml | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'examples/quick/animation/easing') 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 + } } } } -- cgit v1.2.3