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/qquickdial.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/qquickdial.cpp')
-rw-r--r-- | src/quicktemplates2/qquickdial.cpp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/quicktemplates2/qquickdial.cpp b/src/quicktemplates2/qquickdial.cpp index b5957069..03aee27e 100644 --- a/src/quicktemplates2/qquickdial.cpp +++ b/src/quicktemplates2/qquickdial.cpp @@ -679,21 +679,7 @@ void QQuickDial::mousePressEvent(QMouseEvent *event) Q_D(QQuickDial); QQuickControl::mousePressEvent(event); d->handleMove(event->localPos()); -} - -void QQuickDial::mouseMoveEvent(QMouseEvent *event) -{ - Q_D(QQuickDial); - if (!keepMouseGrab()) { - bool overXDragThreshold = QQuickWindowPrivate::dragOverThreshold(event->localPos().x() - d->pressPoint.x(), Qt::XAxis, event); - setKeepMouseGrab(overXDragThreshold); - - if (!overXDragThreshold) { - bool overYDragThreshold = QQuickWindowPrivate::dragOverThreshold(event->localPos().y() - d->pressPoint.y(), Qt::YAxis, event); - setKeepMouseGrab(overYDragThreshold); - } - } - QQuickControl::mouseMoveEvent(event); + setKeepMouseGrab(true); } #if QT_CONFIG(quicktemplates2_multitouch) |