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 /src/quicktemplates2/qquickslider.cpp | |
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 'src/quicktemplates2/qquickslider.cpp')
-rw-r--r-- | src/quicktemplates2/qquickslider.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/src/quicktemplates2/qquickslider.cpp b/src/quicktemplates2/qquickslider.cpp index ef2077af..5ad3c036 100644 --- a/src/quicktemplates2/qquickslider.cpp +++ b/src/quicktemplates2/qquickslider.cpp @@ -684,18 +684,7 @@ void QQuickSlider::mousePressEvent(QMouseEvent *event) Q_D(QQuickSlider); QQuickControl::mousePressEvent(event); d->handleMove(event->localPos()); -} - -void QQuickSlider::mouseMoveEvent(QMouseEvent *event) -{ - Q_D(QQuickSlider); - if (!keepMouseGrab()) { - if (d->orientation == Qt::Horizontal) - setKeepMouseGrab(QQuickWindowPrivate::dragOverThreshold(event->localPos().x() - d->pressPoint.x(), Qt::XAxis, event)); - else - setKeepMouseGrab(QQuickWindowPrivate::dragOverThreshold(event->localPos().y() - d->pressPoint.y(), Qt::YAxis, event)); - } - QQuickControl::mouseMoveEvent(event); + setKeepMouseGrab(true); } #if QT_CONFIG(quicktemplates2_multitouch) |