diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-12-12 21:45:03 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-12-21 19:33:19 +0000 |
commit | 92dff998b3bf73ee0ad9d636454379869318975f (patch) | |
tree | 0a74f43a415594af31352f540fa2496888f508e8 /tests/auto/quick/qquickbehaviors/data | |
parent | fd9d88e3a9f24eb84d029fb9324b4f03ae58ffeb (diff) |
Expose the target value in Behaviors
So that nested animation can use it.
Change-Id: Ief40cda1dfe1ad9a38cf0d18fbf34456dc36e2ee
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickbehaviors/data')
-rw-r--r-- | tests/auto/quick/qquickbehaviors/data/ItemWithInnerBehavior.qml | 1 | ||||
-rw-r--r-- | tests/auto/quick/qquickbehaviors/data/aliased.qml | 1 | ||||
-rw-r--r-- | tests/auto/quick/qquickbehaviors/data/oneway.qml | 20 |
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickbehaviors/data/ItemWithInnerBehavior.qml b/tests/auto/quick/qquickbehaviors/data/ItemWithInnerBehavior.qml index 09983645ef..0ac7f87c42 100644 --- a/tests/auto/quick/qquickbehaviors/data/ItemWithInnerBehavior.qml +++ b/tests/auto/quick/qquickbehaviors/data/ItemWithInnerBehavior.qml @@ -5,6 +5,7 @@ Item { property bool someValue Behavior on someValue { + objectName: "behavior" ScriptAction { script: { parent.behaviorTriggered = true }} } } diff --git a/tests/auto/quick/qquickbehaviors/data/aliased.qml b/tests/auto/quick/qquickbehaviors/data/aliased.qml index e65e035d83..1840cdd22e 100644 --- a/tests/auto/quick/qquickbehaviors/data/aliased.qml +++ b/tests/auto/quick/qquickbehaviors/data/aliased.qml @@ -17,6 +17,7 @@ Rectangle { anchors.fill: parent value: accelerating ? 400 : 0 Behavior on value { + objectName: "behavior" NumberAnimation { duration: 500 } diff --git a/tests/auto/quick/qquickbehaviors/data/oneway.qml b/tests/auto/quick/qquickbehaviors/data/oneway.qml new file mode 100644 index 0000000000..0b438b80f6 --- /dev/null +++ b/tests/auto/quick/qquickbehaviors/data/oneway.qml @@ -0,0 +1,20 @@ +import QtQuick 2.0 +Rectangle { + width: 400 + height: 400 + Rectangle { + id: rect + objectName: "MyRectOneWay" + width: 100; height: 100; color: "green" + Behavior on x { + id: behavior + objectName: "MyBehaviorOneWay"; + enabled: (behavior.targetValue === 0) + NumberAnimation { + id: ani + objectName: "MyAnimationOneWay"; + duration: 200; + } + } + } +} |