diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/generic/tuiotouch/qtuiocursor_p.h | 16 | ||||
-rw-r--r-- | src/plugins/generic/tuiotouch/qtuiohandler.cpp | 13 | ||||
-rw-r--r-- | src/plugins/generic/tuiotouch/qtuiotoken_p.h | 20 | ||||
-rw-r--r-- | src/plugins/platforms/android/androidjniinput.cpp | 12 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qmultitouch_mac.mm | 16 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qmultitouch_mac_p.h | 2 | ||||
-rw-r--r-- | src/plugins/platforms/ios/quiview.mm | 12 | ||||
-rw-r--r-- | src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp | 12 | ||||
-rw-r--r-- | src/plugins/platforms/wasm/qwasmeventtranslator.cpp | 12 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowsmousehandler.cpp | 12 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowspointerhandler.cpp | 10 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 16 |
12 files changed, 76 insertions, 77 deletions
diff --git a/src/plugins/generic/tuiotouch/qtuiocursor_p.h b/src/plugins/generic/tuiotouch/qtuiocursor_p.h index 46134e6f3f..b8301bcf2c 100644 --- a/src/plugins/generic/tuiotouch/qtuiocursor_p.h +++ b/src/plugins/generic/tuiotouch/qtuiocursor_p.h @@ -55,7 +55,7 @@ public: , m_vx(0) , m_vy(0) , m_acceleration(0) - , m_state(Qt::TouchPointPressed) + , m_state(QEventPoint::State::Pressed) { } @@ -63,9 +63,9 @@ public: void setX(float x) { - if (state() == Qt::TouchPointStationary && + if (state() == QEventPoint::State::Stationary && !qFuzzyCompare(m_x + 2.0, x + 2.0)) { // +2 because 1 is a valid value, and qFuzzyCompare can't cope with 0.0 - setState(Qt::TouchPointMoved); + setState(QEventPoint::State::Updated); } m_x = x; } @@ -73,9 +73,9 @@ public: void setY(float y) { - if (state() == Qt::TouchPointStationary && + if (state() == QEventPoint::State::Stationary && !qFuzzyCompare(m_y + 2.0, y + 2.0)) { // +2 because 1 is a valid value, and qFuzzyCompare can't cope with 0.0 - setState(Qt::TouchPointMoved); + setState(QEventPoint::State::Updated); } m_y = y; } @@ -90,8 +90,8 @@ public: void setAcceleration(float acceleration) { m_acceleration = acceleration; } float acceleration() const { return m_acceleration; } - void setState(const Qt::TouchPointState &state) { m_state = state; } - Qt::TouchPointState state() const { return m_state; } + void setState(const QEventPoint::State &state) { m_state = state; } + QEventPoint::State state() const { return m_state; } private: int m_id; @@ -100,7 +100,7 @@ private: float m_vx; float m_vy; float m_acceleration; - Qt::TouchPointState m_state; + QEventPoint::State m_state; }; Q_DECLARE_TYPEINFO(QTuioCursor, Q_MOVABLE_TYPE); // Q_PRIMITIVE_TYPE: not possible, m_state is = 1, not 0. diff --git a/src/plugins/generic/tuiotouch/qtuiohandler.cpp b/src/plugins/generic/tuiotouch/qtuiohandler.cpp index 260dc883af..f61bd906bf 100644 --- a/src/plugins/generic/tuiotouch/qtuiohandler.cpp +++ b/src/plugins/generic/tuiotouch/qtuiohandler.cpp @@ -260,12 +260,12 @@ void QTuioHandler::process2DCurAlive(const QOscMessage &message) if (!oldActiveCursors.contains(cursorId)) { // newly active QTuioCursor cursor(cursorId); - cursor.setState(Qt::TouchPointPressed); + cursor.setState(QEventPoint::State::Pressed); newActiveCursors.insert(cursorId, cursor); } else { // we already know about it, remove it so it isn't marked as released QTuioCursor cursor = oldActiveCursors.value(cursorId); - cursor.setState(Qt::TouchPointStationary); // position change in SET will update if needed + cursor.setState(QEventPoint::State::Stationary); // position change in SET will update if needed newActiveCursors.insert(cursorId, cursor); oldActiveCursors.remove(cursorId); } @@ -378,7 +378,7 @@ void QTuioHandler::process2DCurFseq(const QOscMessage &message) for (const QTuioCursor &tc : qAsConst(m_deadCursors)) { QWindowSystemInterface::TouchPoint tp = cursorToTouchPoint(tc, win); - tp.state = Qt::TouchPointReleased; + tp.state = QEventPoint::State::Released; tpl.append(tp); } QWindowSystemInterface::handleTouchEvent(win, m_device, tpl); @@ -425,12 +425,12 @@ void QTuioHandler::process2DObjAlive(const QOscMessage &message) if (!oldActiveTokens.contains(sessionId)) { // newly active QTuioToken token(sessionId); - token.setState(Qt::TouchPointPressed); + token.setState(QEventPoint::State::Pressed); newActiveTokens.insert(sessionId, token); } else { // we already know about it, remove it so it isn't marked as released QTuioToken token = oldActiveTokens.value(sessionId); - token.setState(Qt::TouchPointStationary); // position change in SET will update if needed + token.setState(QEventPoint::State::Stationary); // position change in SET will update if needed newActiveTokens.insert(sessionId, token); oldActiveTokens.remove(sessionId); } @@ -511,7 +511,6 @@ QWindowSystemInterface::TouchPoint QTuioHandler::tokenToTouchPoint(const QTuioTo QWindowSystemInterface::TouchPoint tp; tp.id = tc.id(); tp.uniqueId = tc.classId(); // TODO TUIO 2.0: populate a QVariant, and register the mapping from int to arbitrary UID data - tp.flags = QTouchEvent::TouchPoint::Token; tp.pressure = 1.0f; tp.normalPosition = QPointF(tc.x(), tc.y()); @@ -552,7 +551,7 @@ void QTuioHandler::process2DObjFseq(const QOscMessage &message) for (const QTuioToken & t : qAsConst(m_deadTokens)) { QWindowSystemInterface::TouchPoint tp = tokenToTouchPoint(t, win); - tp.state = Qt::TouchPointReleased; + tp.state = QEventPoint::State::Released; tp.velocity = QVector2D(); tpl.append(tp); } diff --git a/src/plugins/generic/tuiotouch/qtuiotoken_p.h b/src/plugins/generic/tuiotouch/qtuiotoken_p.h index b784190d53..0c72436c4c 100644 --- a/src/plugins/generic/tuiotouch/qtuiotoken_p.h +++ b/src/plugins/generic/tuiotouch/qtuiotoken_p.h @@ -66,7 +66,7 @@ public: , m_angle(0) , m_angularVelocity(0) , m_angularAcceleration(0) - , m_state(Qt::TouchPointPressed) + , m_state(QEventPoint::State::Pressed) { } @@ -77,9 +77,9 @@ public: void setX(float x) { - if (state() == Qt::TouchPointStationary && + if (state() == QEventPoint::State::Stationary && !qFuzzyCompare(m_x + 2.0, x + 2.0)) { // +2 because 1 is a valid value, and qFuzzyCompare can't cope with 0.0 - setState(Qt::TouchPointMoved); + setState(QEventPoint::State::Updated); } m_x = x; } @@ -87,9 +87,9 @@ public: void setY(float y) { - if (state() == Qt::TouchPointStationary && + if (state() == QEventPoint::State::Stationary && !qFuzzyCompare(m_y + 2.0, y + 2.0)) { // +2 because 1 is a valid value, and qFuzzyCompare can't cope with 0.0 - setState(Qt::TouchPointMoved); + setState(QEventPoint::State::Updated); } m_y = y; } @@ -109,9 +109,9 @@ public: { if (angle > M_PI) angle = angle - M_PI * 2.0; // zero is pointing upwards, and is the default; but we want to have negative angles when rotating left - if (state() == Qt::TouchPointStationary && + if (state() == QEventPoint::State::Stationary && !qFuzzyCompare(m_angle + 2.0, angle + 2.0)) { // +2 because 1 is a valid value, and qFuzzyCompare can't cope with 0.0 - setState(Qt::TouchPointMoved); + setState(QEventPoint::State::Updated); } m_angle = angle; } @@ -122,8 +122,8 @@ public: float angularAcceleration() const { return m_angularAcceleration; } void setAngularAcceleration(float angularAcceleration) { m_angularAcceleration = angularAcceleration; } - void setState(const Qt::TouchPointState &state) { m_state = state; } - Qt::TouchPointState state() const { return m_state; } + void setState(const QEventPoint::State &state) { m_state = state; } + QEventPoint::State state() const { return m_state; } private: int m_id; // sessionID, temporary object ID @@ -136,7 +136,7 @@ private: float m_angle; float m_angularVelocity; float m_angularAcceleration; - Qt::TouchPointState m_state; + QEventPoint::State m_state; }; Q_DECLARE_TYPEINFO(QTuioToken, Q_MOVABLE_TYPE); // Q_PRIMITIVE_TYPE: not possible: m_id, m_classId == -1 diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp index 9906bdffd3..98f56808b7 100644 --- a/src/plugins/platforms/android/androidjniinput.cpp +++ b/src/plugins/platforms/android/androidjniinput.cpp @@ -228,19 +228,19 @@ namespace QtAndroidInput static void touchAdd(JNIEnv */*env*/, jobject /*thiz*/, jint /*winId*/, jint id, jint action, jboolean /*primary*/, jint x, jint y, jfloat major, jfloat minor, jfloat rotation, jfloat pressure) { - Qt::TouchPointState state = Qt::TouchPointStationary; + QEventPoint::State state = QEventPoint::State::Stationary; switch (action) { case 0: - state = Qt::TouchPointPressed; + state = QEventPoint::State::Pressed; break; case 1: - state = Qt::TouchPointMoved; + state = QEventPoint::State::Updated; break; case 2: - state = Qt::TouchPointStationary; + state = QEventPoint::State::Stationary; break; case 3: - state = Qt::TouchPointReleased; + state = QEventPoint::State::Released; break; } @@ -258,7 +258,7 @@ namespace QtAndroidInput double(major * 2)); m_touchPoints.push_back(touchPoint); - if (state == Qt::TouchPointPressed) { + if (state == QEventPoint::State::Pressed) { QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext(); if (inputContext && qGuiApp) QMetaObject::invokeMethod(inputContext, "touchDown", Q_ARG(int, x), Q_ARG(int, y)); diff --git a/src/plugins/platforms/cocoa/qmultitouch_mac.mm b/src/plugins/platforms/cocoa/qmultitouch_mac.mm index 7bbbb486e5..28d641b598 100644 --- a/src/plugins/platforms/cocoa/qmultitouch_mac.mm +++ b/src/plugins/platforms/cocoa/qmultitouch_mac.mm @@ -112,22 +112,22 @@ QCocoaTouch *QCocoaTouch::findQCocoaTouch(NSTouch *nstouch) return nullptr; } -Qt::TouchPointState QCocoaTouch::toTouchPointState(NSTouchPhase nsState) +QEventPoint::State QCocoaTouch::toTouchPointState(NSTouchPhase nsState) { - Qt::TouchPointState qtState = Qt::TouchPointReleased; + QEventPoint::State qtState = QEventPoint::State::Released; switch (nsState) { case NSTouchPhaseBegan: - qtState = Qt::TouchPointPressed; + qtState = QEventPoint::State::Pressed; break; case NSTouchPhaseMoved: - qtState = Qt::TouchPointMoved; + qtState = QEventPoint::State::Updated; break; case NSTouchPhaseStationary: - qtState = Qt::TouchPointStationary; + qtState = QEventPoint::State::Stationary; break; case NSTouchPhaseEnded: case NSTouchPhaseCancelled: - qtState = Qt::TouchPointReleased; + qtState = QEventPoint::State::Released; break; default: break; @@ -191,7 +191,7 @@ QCocoaTouch::getCurrentTouchPointList(NSEvent *event, bool acceptSingleTouch) const auto currentTouchesSnapshot = _currentTouches; for (QCocoaTouch *qcocoaTouch : currentTouchesSnapshot) { if (!_updateInternalStateOnly) { - qcocoaTouch->_touchPoint.state = Qt::TouchPointReleased; + qcocoaTouch->_touchPoint.state = QEventPoint::State::Released; touchPoints.insert(qcocoaTouch->_touchPoint.id, qcocoaTouch->_touchPoint); } delete qcocoaTouch; @@ -207,7 +207,7 @@ QCocoaTouch::getCurrentTouchPointList(NSEvent *event, bool acceptSingleTouch) if (_updateInternalStateOnly && !wasUpdateInternalStateOnly && !_currentTouches.isEmpty()) { QCocoaTouch *qcocoaTouch = _currentTouches.cbegin().value(); - qcocoaTouch->_touchPoint.state = Qt::TouchPointReleased; + qcocoaTouch->_touchPoint.state = QEventPoint::State::Released; touchPoints.insert(qcocoaTouch->_touchPoint.id, qcocoaTouch->_touchPoint); // Since this last touch also will end up being the first // touch (if the user adds a second finger without lifting diff --git a/src/plugins/platforms/cocoa/qmultitouch_mac_p.h b/src/plugins/platforms/cocoa/qmultitouch_mac_p.h index 875a7d365e..ff4479fa4c 100644 --- a/src/plugins/platforms/cocoa/qmultitouch_mac_p.h +++ b/src/plugins/platforms/cocoa/qmultitouch_mac_p.h @@ -88,7 +88,7 @@ class QCocoaTouch void updateTouchData(NSTouch *nstouch, NSTouchPhase phase); static QCocoaTouch *findQCocoaTouch(NSTouch *nstouch); - static Qt::TouchPointState toTouchPointState(NSTouchPhase nsState); + static QEventPoint::State toTouchPointState(NSTouchPhase nsState); }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index d1a0cbf858..f5dd20bace 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -367,7 +367,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") return [super pointInside:point withEvent:event]; } -- (void)handleTouches:(NSSet *)touches withEvent:(UIEvent *)event withState:(Qt::TouchPointState)state withTimestamp:(ulong)timeStamp +- (void)handleTouches:(NSSet *)touches withEvent:(UIEvent *)event withState:(QEventPoint::State)state withTimestamp:(ulong)timeStamp { QIOSIntegration *iosIntegration = QIOSIntegration::instance(); bool supportsPressure = QIOSIntegration::instance()->touchDevice()->capabilities() & QPointingDevice::Capability::Pressure; @@ -417,7 +417,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") } } if (!uiTouch) { - touchPoint.state = Qt::TouchPointStationary; + touchPoint.state = QEventPoint::State::Stationary; } else { touchPoint.state = state; @@ -444,7 +444,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") } else { // We don't claim that our touch device supports QPointingDevice::Capability::Pressure, // but fill in a meaningful value in case clients use it anyway. - touchPoint.pressure = (state == Qt::TouchPointReleased) ? 0.0 : 1.0; + touchPoint.pressure = (state == QEventPoint::State::Released) ? 0.0 : 1.0; } } } @@ -499,17 +499,17 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") topLevel->requestActivateWindow(); } - [self handleTouches:touches withEvent:event withState:Qt::TouchPointPressed withTimestamp:ulong(event.timestamp * 1000)]; + [self handleTouches:touches withEvent:event withState:QEventPoint::State::Pressed withTimestamp:ulong(event.timestamp * 1000)]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { - [self handleTouches:touches withEvent:event withState:Qt::TouchPointMoved withTimestamp:ulong(event.timestamp * 1000)]; + [self handleTouches:touches withEvent:event withState:QEventPoint::State::Updated withTimestamp:ulong(event.timestamp * 1000)]; } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - [self handleTouches:touches withEvent:event withState:Qt::TouchPointReleased withTimestamp:ulong(event.timestamp * 1000)]; + [self handleTouches:touches withEvent:event withState:QEventPoint::State::Released withTimestamp:ulong(event.timestamp * 1000)]; // Remove ended touch points from the active set: #ifndef Q_OS_TVOS diff --git a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp index 40033d05c9..5653c9ee57 100644 --- a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp +++ b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp @@ -160,7 +160,7 @@ QQnxScreenEventHandler::QQnxScreenEventHandler(QQnxIntegration *integration) m_touchPoints[i].pressure = 1.0; // nothing touching - m_touchPoints[i].state = Qt::TouchPointReleased; + m_touchPoints[i].state = QEventPoint::State::Released; } } @@ -544,15 +544,15 @@ void QQnxScreenEventHandler::handleTouchEvent(screen_event_t event, int qnxType) QEvent::Type type = QEvent::None; switch (qnxType) { case SCREEN_EVENT_MTOUCH_TOUCH: - m_touchPoints[touchId].state = Qt::TouchPointPressed; + m_touchPoints[touchId].state = QEventPoint::State::Pressed; type = QEvent::TouchBegin; break; case SCREEN_EVENT_MTOUCH_MOVE: - m_touchPoints[touchId].state = Qt::TouchPointMoved; + m_touchPoints[touchId].state = QEventPoint::State::Updated; type = QEvent::TouchUpdate; break; case SCREEN_EVENT_MTOUCH_RELEASE: - m_touchPoints[touchId].state = Qt::TouchPointReleased; + m_touchPoints[touchId].state = QEventPoint::State::Released; type = QEvent::TouchEnd; break; } @@ -563,9 +563,9 @@ void QQnxScreenEventHandler::handleTouchEvent(screen_event_t event, int qnxType) if (i == touchId) { // current touch point is always active pointList.append(m_touchPoints[i]); - } else if (m_touchPoints[i].state != Qt::TouchPointReleased) { + } else if (m_touchPoints[i].state != QEventPoint::State::Released) { // finger is down but did not move - m_touchPoints[i].state = Qt::TouchPointStationary; + m_touchPoints[i].state = QEventPoint::State::Stationary; pointList.append(m_touchPoints[i]); } } diff --git a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp index 41e4b557c0..2387f3cdea 100644 --- a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp +++ b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp @@ -738,22 +738,22 @@ int QWasmEventTranslator::handleTouch(int eventType, const EmscriptenTouchEvent case EMSCRIPTEN_EVENT_TOUCHSTART: if (tp != pressedTouchIds.constEnd()) { touchPoint.state = (stationaryTouchPoint - ? Qt::TouchPointStationary - : Qt::TouchPointMoved); + ? QEventPoint::State::Stationary + : QEventPoint::State::Updated); } else { - touchPoint.state = Qt::TouchPointPressed; + touchPoint.state = QEventPoint::State::Pressed; } pressedTouchIds.insert(touchPoint.id, touchPoint.normalPosition); break; case EMSCRIPTEN_EVENT_TOUCHEND: - touchPoint.state = Qt::TouchPointReleased; + touchPoint.state = QEventPoint::State::Released; pressedTouchIds.remove(touchPoint.id); break; case EMSCRIPTEN_EVENT_TOUCHMOVE: touchPoint.state = (stationaryTouchPoint - ? Qt::TouchPointStationary - : Qt::TouchPointMoved); + ? QEventPoint::State::Stationary + : QEventPoint::State::Updated); pressedTouchIds.insert(touchPoint.id, touchPoint.normalPosition); break; diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp index 13dd324a09..5e2710bc28 100644 --- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp +++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp @@ -601,7 +601,7 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND, QTouchPointList touchPoints; touchPoints.reserve(winTouchPointCount); - Qt::TouchPointStates allStates; + QEventPoint::States allStates; GetTouchInputInfo(reinterpret_cast<HTOUCHINPUT>(msg.lParam), UINT(msg.wParam), winTouchInputs.data(), sizeof(TOUCHINPUT)); @@ -628,15 +628,15 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND, touchPoint.normalPosition = normalPosition; if (winTouchInput.dwFlags & TOUCHEVENTF_DOWN) { - touchPoint.state = Qt::TouchPointPressed; + touchPoint.state = QEventPoint::State::Pressed; m_lastTouchPositions.insert(id, touchPoint.normalPosition); } else if (winTouchInput.dwFlags & TOUCHEVENTF_UP) { - touchPoint.state = Qt::TouchPointReleased; + touchPoint.state = QEventPoint::State::Released; m_lastTouchPositions.remove(id); } else { touchPoint.state = (stationaryTouchPoint - ? Qt::TouchPointStationary - : Qt::TouchPointMoved); + ? QEventPoint::State::Stationary + : QEventPoint::State::Updated); m_lastTouchPositions.insert(id, touchPoint.normalPosition); } @@ -648,7 +648,7 @@ bool QWindowsMouseHandler::translateTouchEvent(QWindow *window, HWND, CloseTouchInputHandle(reinterpret_cast<HTOUCHINPUT>(msg.lParam)); // all touch points released, forget the ids we've seen, they may not be reused - if (allStates == Qt::TouchPointReleased) + if (allStates == QEventPoint::State::Released) m_touchInputIDToTouchPointID.clear(); QWindowSystemInterface::handleTouchEvent(window, diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.cpp b/src/plugins/platforms/windows/qwindowspointerhandler.cpp index 7dc2bd729a..d5c3aeacff 100644 --- a/src/plugins/platforms/windows/qwindowspointerhandler.cpp +++ b/src/plugins/platforms/windows/qwindowspointerhandler.cpp @@ -491,7 +491,7 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd, << " message=" << Qt::hex << msg.message << " count=" << Qt::dec << count; - Qt::TouchPointStates allStates; + QEventPoint::States allStates; for (quint32 i = 0; i < count; ++i) { if (QWindowsContext::verbose > 1) @@ -526,13 +526,13 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd, touchPoint.normalPosition = normalPosition; if (touchInfo[i].pointerInfo.pointerFlags & POINTER_FLAG_DOWN) { - touchPoint.state = Qt::TouchPointPressed; + touchPoint.state = QEventPoint::State::Pressed; m_lastTouchPositions.insert(touchPoint.id, touchPoint.normalPosition); } else if (touchInfo[i].pointerInfo.pointerFlags & POINTER_FLAG_UP) { - touchPoint.state = Qt::TouchPointReleased; + touchPoint.state = QEventPoint::State::Released; m_lastTouchPositions.remove(touchPoint.id); } else { - touchPoint.state = stationaryTouchPoint ? Qt::TouchPointStationary : Qt::TouchPointMoved; + touchPoint.state = stationaryTouchPoint ? QEventPoint::State::Stationary : QEventPoint::State::Updated; m_lastTouchPositions.insert(touchPoint.id, touchPoint.normalPosition); } allStates |= touchPoint.state; @@ -544,7 +544,7 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd, } // all touch points released, forget the ids we've seen. - if (allStates == Qt::TouchPointReleased) + if (allStates == QEventPoint::State::Released) m_touchInputIDToTouchPointID.clear(); QWindowSystemInterface::handleTouchEvent(window, m_touchDevice, touchPoints, diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 74044db0de..dc8a533388 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -819,7 +819,7 @@ void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindo if (xiDeviceEvent->event_type == XCB_INPUT_TOUCH_BEGIN) { QWindowSystemInterface::TouchPoint tp; tp.id = xiDeviceEvent->detail % INT_MAX; - tp.state = Qt::TouchPointPressed; + tp.state = QEventPoint::State::Pressed; tp.pressure = -1.0; dev->touchPoints[tp.id] = tp; } @@ -926,9 +926,9 @@ void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindo dev->size.height() * screen->geometry().height() / screen->physicalSize().height(); x = dev->firstPressedPosition.x() + dx; y = dev->firstPressedPosition.y() + dy; - touchPoint.state = Qt::TouchPointMoved; + touchPoint.state = QEventPoint::State::Updated; } else if (touchPoint.area.center() != QPoint(x, y)) { - touchPoint.state = Qt::TouchPointMoved; + touchPoint.state = QEventPoint::State::Updated; if (dev->qtTouchDevice->type() == QInputDevice::DeviceType::TouchPad) dev->pointPressedPosition[touchPoint.id] = QPointF(x, y); } @@ -948,7 +948,7 @@ void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindo } break; case XCB_INPUT_TOUCH_END: - touchPoint.state = Qt::TouchPointReleased; + touchPoint.state = QEventPoint::State::Released; if (dev->qtTouchDevice->type() == QInputDevice::DeviceType::TouchPad && dev->pointPressedPosition.value(touchPoint.id) == QPointF(x, y)) { qreal dx = (nx - dev->firstPressedNormalPosition.x()) * dev->size.width() * screen->geometry().width() / screen->physicalSize().width(); @@ -967,13 +967,13 @@ void QXcbConnection::xi2ProcessTouch(void *xiDevEvent, QXcbWindow *platformWindo " area " << touchPoint.area << " pressure " << touchPoint.pressure; Qt::KeyboardModifiers modifiers = keyboard()->translateModifiers(xiDeviceEvent->mods.effective); QWindowSystemInterface::handleTouchEvent(platformWindow->window(), xiDeviceEvent->time, dev->qtTouchDevice, dev->touchPoints.values(), modifiers); - if (touchPoint.state == Qt::TouchPointReleased) + if (touchPoint.state == QEventPoint::State::Released) // If a touchpoint was released, we can forget it, because the ID won't be reused. dev->touchPoints.remove(touchPoint.id); else // Make sure that we don't send TouchPointPressed/Moved in more than one QTouchEvent // with this touch point if the next XI2 event is about a different touch point. - touchPoint.state = Qt::TouchPointStationary; + touchPoint.state = QEventPoint::State::Stationary; } bool QXcbConnection::startSystemMoveResizeForTouch(xcb_window_t window, int edges) @@ -984,8 +984,8 @@ bool QXcbConnection::startSystemMoveResizeForTouch(xcb_window_t window, int edge if (deviceData.qtTouchDevice->type() == QInputDevice::DeviceType::TouchScreen) { auto pointIt = deviceData.touchPoints.constBegin(); for (; pointIt != deviceData.touchPoints.constEnd(); ++pointIt) { - Qt::TouchPointState state = pointIt.value().state; - if (state == Qt::TouchPointMoved || state == Qt::TouchPointPressed || state == Qt::TouchPointStationary) { + QEventPoint::State state = pointIt.value().state; + if (state == QEventPoint::State::Updated || state == QEventPoint::State::Pressed || state == QEventPoint::State::Stationary) { m_startSystemMoveResizeInfo.window = window; m_startSystemMoveResizeInfo.deviceid = devIt.key(); m_startSystemMoveResizeInfo.pointid = pointIt.key(); |