diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-02-15 13:14:49 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2021-03-19 13:17:06 +0100 |
commit | af7e85bf55ec24492cfdee12394a7aa4e5031228 (patch) | |
tree | 4a36984a9881722464113a86ed6c9677b3241016 /src/quick/handlers | |
parent | 1bc7b77d7eff77b3761e543a18e4c7a795ea9f43 (diff) |
Remove QQWindowPriv::is[Mouse|Touch|Tablet]Event
They are moved to QQuickDeliveryAgentPrivate.
Change-Id: I5d6656dd6362dd03f0f4321cff07a8b207fadd39
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/quick/handlers')
-rw-r--r-- | src/quick/handlers/qquickdraghandler.cpp | 4 | ||||
-rw-r--r-- | src/quick/handlers/qquickhandlerpoint.cpp | 4 | ||||
-rw-r--r-- | src/quick/handlers/qquickhoverhandler.cpp | 4 | ||||
-rw-r--r-- | src/quick/handlers/qquickmultipointhandler.cpp | 2 | ||||
-rw-r--r-- | src/quick/handlers/qquickpointerhandler.cpp | 4 | ||||
-rw-r--r-- | src/quick/handlers/qquickpointhandler.cpp | 4 | ||||
-rw-r--r-- | src/quick/handlers/qquicktaphandler.cpp | 7 |
7 files changed, 15 insertions, 14 deletions
diff --git a/src/quick/handlers/qquickdraghandler.cpp b/src/quick/handlers/qquickdraghandler.cpp index e5e9b03f32..d359002592 100644 --- a/src/quick/handlers/qquickdraghandler.cpp +++ b/src/quick/handlers/qquickdraghandler.cpp @@ -162,7 +162,7 @@ void QQuickDragHandler::onActiveChanged() QQuickMultiPointHandler::onActiveChanged(); if (active()) { if (auto parent = parentItem()) { - if (QQuickWindowPrivate::isTouchEvent(currentEvent())) + if (QQuickDeliveryAgentPrivate::isTouchEvent(currentEvent())) parent->setKeepTouchGrab(true); // tablet and mouse are treated the same by Item's legacy event handling, and // touch becomes synth-mouse for Flickable, so we need to prevent stealing @@ -251,7 +251,7 @@ void QQuickDragHandler::handlePointerEventImpl(QPointerEvent *event) // (That affects behavior for mouse but not for touch, because Flickable only handles mouse.) // So we have to compensate by accepting the event here to avoid any parent Flickable from // getting the event via direct delivery and grabbing too soon. - point->setAccepted(QQuickWindowPrivate::isMouseEvent(event)); // stop propagation iff it's a mouse event + point->setAccepted(QQuickDeliveryAgentPrivate::isMouseEvent(event)); // stop propagation iff it's a mouse event } } if (allOverThreshold) { diff --git a/src/quick/handlers/qquickhandlerpoint.cpp b/src/quick/handlers/qquickhandlerpoint.cpp index 7b804a477c..54951b82b3 100644 --- a/src/quick/handlers/qquickhandlerpoint.cpp +++ b/src/quick/handlers/qquickhandlerpoint.cpp @@ -110,7 +110,7 @@ void QQuickHandlerPoint::reset(const QPointerEvent *event, const QEventPoint &po default: break; } - const bool isTouch = QQuickWindowPrivate::isTouchEvent(event); + const bool isTouch = QQuickDeliveryAgentPrivate::isTouchEvent(event); if (!isTouch) m_pressedButtons = static_cast<const QSinglePointEvent *>(event)->buttons(); m_pressedModifiers = event->modifiers(); @@ -120,7 +120,7 @@ void QQuickHandlerPoint::reset(const QPointerEvent *event, const QEventPoint &po m_pressure = point.pressure(); m_ellipseDiameters = point.ellipseDiameters(); #if QT_CONFIG(tabletevent) - } else if (QQuickWindowPrivate::isTabletEvent(event)) { + } else if (QQuickDeliveryAgentPrivate::isTabletEvent(event)) { m_uniqueId = event->pointingDevice()->uniqueId(); m_rotation = point.rotation(); m_pressure = point.pressure(); diff --git a/src/quick/handlers/qquickhoverhandler.cpp b/src/quick/handlers/qquickhoverhandler.cpp index a22d5ddcae..b934940126 100644 --- a/src/quick/handlers/qquickhoverhandler.cpp +++ b/src/quick/handlers/qquickhoverhandler.cpp @@ -122,7 +122,7 @@ bool QQuickHoverHandler::wantsPointerEvent(QPointerEvent *event) // the hovered property to transition to false prematurely. // If a QQuickPointerTabletEvent caused the hovered property to become true, // then only another QQuickPointerTabletEvent can make it become false. - if (!(m_hoveredTablet && QQuickWindowPrivate::isMouseEvent(event))) + if (!(m_hoveredTablet && QQuickDeliveryAgentPrivate::isMouseEvent(event))) setHovered(false); return false; @@ -134,7 +134,7 @@ void QQuickHoverHandler::handleEventPoint(QPointerEvent *ev, QEventPoint &point) if (point.state() == QEventPoint::Released && ev->pointingDevice()->pointerType() == QPointingDevice::PointerType::Finger) hovered = false; - else if (QQuickWindowPrivate::isTabletEvent(ev)) + else if (QQuickDeliveryAgentPrivate::isTabletEvent(ev)) m_hoveredTablet = true; setHovered(hovered); setPassiveGrab(ev, point); diff --git a/src/quick/handlers/qquickmultipointhandler.cpp b/src/quick/handlers/qquickmultipointhandler.cpp index 97cb958aa6..ec4fa7a18f 100644 --- a/src/quick/handlers/qquickmultipointhandler.cpp +++ b/src/quick/handlers/qquickmultipointhandler.cpp @@ -164,7 +164,7 @@ QVector<QEventPoint> QQuickMultiPointHandler::eligiblePoints(QPointerEvent *even bool stealingAllowed = event->isBeginEvent() || event->isEndEvent(); for (int i = 0; i < event->pointCount(); ++i) { auto &p = QMutableEventPoint::from(event->point(i)); - if (QQuickWindowPrivate::isMouseEvent(event)) { + if (QQuickDeliveryAgentPrivate::isMouseEvent(event)) { if (static_cast<QMouseEvent *>(event)->buttons() == Qt::NoButton) continue; } diff --git a/src/quick/handlers/qquickpointerhandler.cpp b/src/quick/handlers/qquickpointerhandler.cpp index f9ae620c75..c0eb00ed50 100644 --- a/src/quick/handlers/qquickpointerhandler.cpp +++ b/src/quick/handlers/qquickpointerhandler.cpp @@ -351,8 +351,8 @@ bool QQuickPointerHandler::approveGrabTransition(QPointerEvent *event, const QEv allowed = true; } else if ((d->grabPermissions & CanTakeOverFromItems)) { QQuickItem * existingItemGrabber = qobject_cast<QQuickItem *>(event->exclusiveGrabber(point)); - if (existingItemGrabber && !((existingItemGrabber->keepMouseGrab() && QQuickWindowPrivate::isMouseEvent(event)) || - (existingItemGrabber->keepTouchGrab() && QQuickWindowPrivate::isTouchEvent(event)))) { + if (existingItemGrabber && !((existingItemGrabber->keepMouseGrab() && QQuickDeliveryAgentPrivate::isMouseEvent(event)) || + (existingItemGrabber->keepTouchGrab() && QQuickDeliveryAgentPrivate::isTouchEvent(event)))) { allowed = true; // If the handler wants to steal the exclusive grab from an Item, the Item can usually veto // by having its keepMouseGrab flag set. But an exception is if that Item is a parent that diff --git a/src/quick/handlers/qquickpointhandler.cpp b/src/quick/handlers/qquickpointhandler.cpp index 147724e5b3..3ce95db51a 100644 --- a/src/quick/handlers/qquickpointhandler.cpp +++ b/src/quick/handlers/qquickpointhandler.cpp @@ -140,14 +140,14 @@ void QQuickPointHandler::handleEventPoint(QPointerEvent *event, QEventPoint &poi { switch (point.state()) { case QEventPoint::Pressed: - if (QQuickWindowPrivate::isTouchEvent(event) || + if (QQuickDeliveryAgentPrivate::isTouchEvent(event) || (static_cast<const QSinglePointEvent *>(event)->buttons() & acceptedButtons()) != Qt::NoButton) { setPassiveGrab(event, point); setActive(true); } break; case QEventPoint::Released: - if (QQuickWindowPrivate::isTouchEvent(event) || + if (QQuickDeliveryAgentPrivate::isTouchEvent(event) || (static_cast<const QSinglePointEvent *>(event)->buttons() & acceptedButtons()) == Qt::NoButton) setActive(false); break; diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp index 0a7cc7e075..9ef2a138a3 100644 --- a/src/quick/handlers/qquicktaphandler.cpp +++ b/src/quick/handlers/qquicktaphandler.cpp @@ -99,8 +99,9 @@ QQuickTapHandler::QQuickTapHandler(QQuickItem *parent) bool QQuickTapHandler::wantsEventPoint(const QPointerEvent *event, const QEventPoint &point) { - if (!QQuickWindowPrivate::isMouseEvent(event) && !QQuickWindowPrivate::isTouchEvent(event) && - !QQuickWindowPrivate::isTabletEvent(event)) + if (!QQuickDeliveryAgentPrivate::isMouseEvent(event) && + !QQuickDeliveryAgentPrivate::isTouchEvent(event) && + !QQuickDeliveryAgentPrivate::isTabletEvent(event)) return false; // If the user has not violated any constraint, it could be a tap. // Otherwise we want to give up the grab so that a competing handler @@ -154,7 +155,7 @@ void QQuickTapHandler::handleEventPoint(QPointerEvent *event, QEventPoint &point setPressed(true, false, event, point); break; case QEventPoint::Released: { - if (QQuickWindowPrivate::isTouchEvent(event) || + if (QQuickDeliveryAgentPrivate::isTouchEvent(event) || (static_cast<const QSinglePointEvent *>(event)->buttons() & acceptedButtons()) == Qt::NoButton) setPressed(false, false, event, point); break; |