diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp index 4a1e904838..802362ca86 100644 --- a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp +++ b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp @@ -384,23 +384,6 @@ void QQnxScreenEventHandler::handleTouchEvent(screen_event_t event, int qnxType) m_lastMouseWindow = qnxWindow; if (w) { - // convert primary touch to mouse event - if (touchId == 0) { - - // convert point to local coordinates - QPoint globalPoint(pos[0], pos[1]); - QPoint localPoint(windowPos[0], windowPos[1]); - - // map touch state to button state - Qt::MouseButtons buttons = (qnxType == SCREEN_EVENT_MTOUCH_RELEASE) ? Qt::NoButton : Qt::LeftButton; - - // inject event into Qt - QWindowSystemInterface::handleMouseEvent(w, localPoint, globalPoint, buttons); - qScreenEventDebug() << Q_FUNC_INFO << "Qt mouse, w =" << w - << ", (" << localPoint.x() << "," << localPoint.y() - << "), b =" << buttons; - } - // get size of screen which contains window QPlatformScreen *platformScreen = QPlatformScreen::platformScreenForWindow(w); QSizeF screenSize = platformScreen->physicalSize(); @@ -444,6 +427,23 @@ void QQnxScreenEventHandler::handleTouchEvent(screen_event_t event, int qnxType) qScreenEventDebug() << Q_FUNC_INFO << "Qt touch, w =" << w << ", p=(" << pos[0] << "," << pos[1] << "), t=" << type; + + // convert primary touch to mouse event + if (touchId == 0) { + + // convert point to local coordinates + QPoint globalPoint(pos[0], pos[1]); + QPoint localPoint(windowPos[0], windowPos[1]); + + // map touch state to button state + Qt::MouseButtons buttons = (qnxType == SCREEN_EVENT_MTOUCH_RELEASE) ? Qt::NoButton : Qt::LeftButton; + + // inject event into Qt + QWindowSystemInterface::handleMouseEvent(w, localPoint, globalPoint, buttons); + qScreenEventDebug() << Q_FUNC_INFO << "Qt mouse, w =" << w + << ", (" << localPoint.x() << "," << localPoint.y() + << "), b =" << buttons; + } } } } |