Ensure Behavior stops animating when a new value is set while disabled.
authorMichael Brasser <michael.brasser@jollamobile.com>
Mon, 10 Feb 2014 16:16:08 +0000 (10:16 -0600)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 20 Feb 2014 03:27:24 +0000 (04:27 +0100)
commitbd510dfa02f33fa497894fe8aa4236f7d8705482
tree2a07b5c25506daa889de8d52d921ec34b4b7ffd5
parent7da483bfbefcaabb1dbbf3e2f1d5b5f7aadc3b06
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>
src/quick/util/qquickbehavior.cpp
tests/auto/quick/qquickbehaviors/data/disabledWriteWhileRunning.qml [new file with mode: 0644]
tests/auto/quick/qquickbehaviors/data/disabledWriteWhileRunning2.qml [new file with mode: 0644]
tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp