diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-08-16 11:29:29 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2019-09-19 16:13:57 +0200 |
commit | 3fb574d01c106e786f9a43ef1e0d781e156d52fa (patch) | |
tree | 4ff601c6152c20dbee98efd97f0ad72e5fc3767d | |
parent | b9ba1ed06f63053b6fe5426cc1cc726b6b85592f (diff) |
-rw-r--r-- | src/quick/handlers/qquickhoverhandler.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/quick/handlers/qquickhoverhandler.cpp b/src/quick/handlers/qquickhoverhandler.cpp index a6325e084b..79cb288af8 100644 --- a/src/quick/handlers/qquickhoverhandler.cpp +++ b/src/quick/handlers/qquickhoverhandler.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtQuick module of the Qt Toolkit. @@ -72,9 +72,6 @@ QQuickHoverHandler::QQuickHoverHandler(QQuickItem *parent) { // Tell QQuickPointerDeviceHandler::wantsPointerEvent() to ignore button state d_func()->acceptedButtons = Qt::NoButton; - // Rule out the touchscreen for now (can be overridden in QML in case a hover-detecting touchscreen exists) - setAcceptedDevices(static_cast<QQuickPointerDevice::DeviceType>( - static_cast<int>(QQuickPointerDevice::AllDevices) ^ static_cast<int>(QQuickPointerDevice::TouchScreen))); } QQuickHoverHandler::~QQuickHoverHandler() @@ -103,7 +100,11 @@ bool QQuickHoverHandler::wantsPointerEvent(QQuickPointerEvent *event) void QQuickHoverHandler::handleEventPoint(QQuickEventPoint *point) { - setHovered(true); + bool hovered = true; + if (point->state() == QQuickEventPoint::Released && + point->pointerEvent()->device()->pointerType() == QQuickPointerDevice::Finger) + hovered = false; + setHovered(hovered); setPassiveGrab(point); } |