diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-03-13 09:50:14 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-04-27 03:49:51 +0000 |
commit | 3d55d182704e2c2b01aa3e5fc159507e322dd281 (patch) | |
tree | 2c7308cca349ddfec4de657496f80c399accf87f /tests/auto/quick/qquickboundaryrule/data/dragHandler.qml | |
parent | 0bcaed279fc303ffd0fd6e77b0ebc83a4519ac74 (diff) |
Add BoundaryRule
[ChangeLog][Qt Labs Animation] Added the BoundaryRule QML type, a
PropertyValueInterceptor that restricts the range of values a numeric
property can have, applies "resistance" when the value is overshooting,
and provides the ability to animate it back within range.
Change-Id: I677b407a351c12b0c5b23c34a45933154310c2cd
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickboundaryrule/data/dragHandler.qml')
-rw-r--r-- | tests/auto/quick/qquickboundaryrule/data/dragHandler.qml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickboundaryrule/data/dragHandler.qml b/tests/auto/quick/qquickboundaryrule/data/dragHandler.qml new file mode 100644 index 0000000000..c66fd76ff1 --- /dev/null +++ b/tests/auto/quick/qquickboundaryrule/data/dragHandler.qml @@ -0,0 +1,23 @@ +import QtQuick 2.14 +import Qt.labs.animation 1.0 + +Rectangle { + id: root + width: 240; height: 120 + color: "green" + + DragHandler { + id: dragHandler + yAxis.minimum: -1000 + xAxis.minimum: -1000 + onActiveChanged: if (!active) xbr.returnToBounds(); + } + + BoundaryRule on x { + id: xbr + minimum: -50 + maximum: 100 + minimumOvershoot: 40 + maximumOvershoot: 40 + } +} |