diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-03-12 13:27:59 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-03-12 13:03:02 +0000 |
commit | ec9aa9f12142de82315eb6d37f121311ec8408bc (patch) | |
tree | 091c76e4e63c6a57a058afc4c0b1e8c261e04860 /tests | |
parent | 031a1e89e1baa952225c0f036b605f591f554e9b (diff) |
Sliders and Dials: keep mouse grab on press
Since Qt 5.9, Sliders and Dials react immediately on mouse press. Thus,
the old logic to keep mouse grab if the drag threshold was exceeded no
longer makes sense with mouse. Don't allow e.g. Drawer to steal mouse
press if a Slider or Dial is already being dragged.
Task-number: QTBUG-66637
Change-Id: I76f7ab59180c1f3fb66db8412d7cccfbd373aee3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qquickdrawer/tst_qquickdrawer.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/qquickdrawer/tst_qquickdrawer.cpp b/tests/auto/qquickdrawer/tst_qquickdrawer.cpp index bba1cf45..e3a6ccf2 100644 --- a/tests/auto/qquickdrawer/tst_qquickdrawer.cpp +++ b/tests/auto/qquickdrawer/tst_qquickdrawer.cpp @@ -1263,13 +1263,17 @@ void tst_QQuickDrawer::nonModal() void tst_QQuickDrawer::slider_data() { QTest::addColumn<bool>("mouse"); - QTest::newRow("mouse") << true; - QTest::newRow("touch") << false; + QTest::addColumn<int>("delta"); + + QTest::newRow("mouse") << true << 2; + QTest::newRow("touch") << false << 2; + QTest::newRow("mouse,delta") << true << 296 / 8; } void tst_QQuickDrawer::slider() { QFETCH(bool, mouse); + QFETCH(int, delta); QQuickApplicationHelper helper(this, QStringLiteral("slider.qml")); QQuickWindow *window = helper.window; @@ -1295,7 +1299,7 @@ void tst_QQuickDrawer::slider() QTest::touchEvent(window, touchDevice.data()).press(0, from); int distance = qAbs(from.x() - to.x()); - for (int dx = 2; dx < distance; dx += 2) { + for (int dx = delta; dx <= distance; dx += delta) { if (mouse) QTest::mouseMove(window, from - QPoint(dx, 0)); else |