diff options
author | Oleg Yadrov <oleg.yadrov@qt.io> | 2017-01-24 16:39:28 -0800 |
---|---|---|
committer | Oleg Yadrov <oleg.yadrov@qt.io> | 2017-02-03 02:32:16 +0000 |
commit | bf19d3294f83fc061eddc719bc608bb19e500a5a (patch) | |
tree | 0fe9facb85bca2974cc208480e934bdce17f60a8 /tests/auto/quick/qquickmousearea/data | |
parent | 22b03fd6d3efdfa0385ced2450c6c7dfcf555d6e (diff) |
MouseArea: fix bug preventing dragging from start
The same bounded dragPos values were used for
- moving the target item to new position; and
- if dragging didn’t start yet, determining whether cursor moved over
the threshold distance.
It is right for moving the target item, but in the second case it led to
that dragging did not start if the distance between item's left border
and minimumX (right border and maximumX, top border and minimumY,
bottom border and maximumY accordingly) was less than drag.threshold.
Task-number: QTBUG-58347
Change-Id: If61a98bf734739323ef19dee6709560b754b2456
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
Diffstat (limited to 'tests/auto/quick/qquickmousearea/data')
-rw-r--r-- | tests/auto/quick/qquickmousearea/data/availableDistanceLessThanDragThreshold.qml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickmousearea/data/availableDistanceLessThanDragThreshold.qml b/tests/auto/quick/qquickmousearea/data/availableDistanceLessThanDragThreshold.qml new file mode 100644 index 0000000000..2b45a19340 --- /dev/null +++ b/tests/auto/quick/qquickmousearea/data/availableDistanceLessThanDragThreshold.qml @@ -0,0 +1,24 @@ +import QtQuick 2.0 + +Rectangle { + width: 400 + height: 200 + + MouseArea { + id: mouseArea + objectName: "mouseArea" + width: 200 + height: 200 + + drag.target: mouseArea + drag.axis: Drag.XAxis + drag.minimumX: 0 + drag.maximumX: 200 + drag.threshold: 200 + + Rectangle { + anchors.fill: parent + color: "red" + } + } +} |