From ec9aa9f12142de82315eb6d37f121311ec8408bc Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 12 Mar 2018 13:27:59 +0100 Subject: 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 --- src/quicktemplates2/qquickdial.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'src/quicktemplates2/qquickdial.cpp') 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) -- cgit v1.2.3