diff options
author | Michael Brasser <michael.brasser@jollamobile.com> | 2014-02-10 10:16:08 -0600 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-20 04:27:24 +0100 |
commit | bd510dfa02f33fa497894fe8aa4236f7d8705482 (patch) | |
tree | 2a07b5c25506daa889de8d52d921ec34b4b7ffd5 /tests/auto/quick/qquickbehaviors/data | |
parent | 7da483bfbefcaabb1dbbf3e2f1d5b5f7aadc3b06 (diff) |
Ensure Behavior stops animating when a new value is set while disabled.
Otherwise the Behavior could cause the property value to end up in an
unwanted and inconsistent state. For example, in the following case:
x: myXValue
Behavior on x { NumberAnimation {} }
x could end up *not equal* to myXValue if myXValue was changed while
the Behavior was still animating but currently disabled.
Change-Id: I3826fdc3f48b2722e778638b116546db7e831e87
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Diffstat (limited to 'tests/auto/quick/qquickbehaviors/data')
-rw-r--r-- | tests/auto/quick/qquickbehaviors/data/disabledWriteWhileRunning.qml | 14 | ||||
-rw-r--r-- | tests/auto/quick/qquickbehaviors/data/disabledWriteWhileRunning2.qml | 14 |
2 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickbehaviors/data/disabledWriteWhileRunning.qml b/tests/auto/quick/qquickbehaviors/data/disabledWriteWhileRunning.qml new file mode 100644 index 0000000000..1ec3a923d4 --- /dev/null +++ b/tests/auto/quick/qquickbehaviors/data/disabledWriteWhileRunning.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 +Rectangle { + width: 400 + height: 400 + Rectangle { + id: rect + objectName: "MyRect" + width: 100; height: 100; color: "green" + Behavior on x { + objectName: "MyBehavior" + NumberAnimation { id: myAnimation; objectName: "MyAnimation"; duration: 1000; } + } + } +} diff --git a/tests/auto/quick/qquickbehaviors/data/disabledWriteWhileRunning2.qml b/tests/auto/quick/qquickbehaviors/data/disabledWriteWhileRunning2.qml new file mode 100644 index 0000000000..fcd9c06de9 --- /dev/null +++ b/tests/auto/quick/qquickbehaviors/data/disabledWriteWhileRunning2.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 +Rectangle { + width: 400 + height: 400 + Rectangle { + id: rect + objectName: "MyRect" + width: 100; height: 100; color: "green" + Behavior on x { + objectName: "MyBehavior" + SmoothedAnimation { id: myAnimation; objectName: "MyAnimation"; duration: 1000; velocity: -1 } + } + } +} |