diff options
Diffstat (limited to 'src/quick/handlers/qquickhoverhandler.cpp')
-rw-r--r-- | src/quick/handlers/qquickhoverhandler.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/quick/handlers/qquickhoverhandler.cpp b/src/quick/handlers/qquickhoverhandler.cpp index 16e5ef5ef3..5bf53235c5 100644 --- a/src/quick/handlers/qquickhoverhandler.cpp +++ b/src/quick/handlers/qquickhoverhandler.cpp @@ -33,7 +33,7 @@ Q_LOGGING_CATEGORY(lcHoverHandler, "qt.quick.handler.hover") The \l cursorShape property allows changing the cursor whenever \l hovered changes to \c true. - \sa MouseArea, PointHandler + \sa MouseArea, PointHandler, {Qt Quick Examples - Pointer Handlers} */ class QQuickHoverHandlerPrivate : public QQuickSinglePointHandlerPrivate @@ -145,7 +145,8 @@ bool QQuickHoverHandler::wantsPointerEvent(QPointerEvent *event) if (event->isSinglePointEvent() && static_cast<QSinglePointEvent *>(event)->button()) return false; auto &point = event->point(0); - if (QQuickPointerDeviceHandler::wantsPointerEvent(event) && wantsEventPoint(event, point) && parentContains(point)) { + const bool inside = parentContains(point); + if (QQuickPointerDeviceHandler::wantsPointerEvent(event) && wantsEventPoint(event, point) && inside) { // assume this is a mouse or tablet event, so there's only one point setPointId(point.id()); return true; @@ -162,7 +163,7 @@ bool QQuickHoverHandler::wantsPointerEvent(QPointerEvent *event) // But after kCursorOverrideTimeout ms, QQuickItemPrivate::effectiveCursorHandler() // will ignore it, just in case there is no QQuickPointerTabletEvent to unset it. // For example, a tablet proximity leave event could occur, but we don't deliver it to the window. - if (!(m_hoveredTablet && QQuickDeliveryAgentPrivate::isMouseEvent(event))) + if (!inside || !(m_hoveredTablet && QQuickDeliveryAgentPrivate::isMouseEvent(event))) setHovered(false); return false; @@ -230,6 +231,9 @@ void QQuickHoverHandler::setHovered(bool hovered) \value PointerDevice.Puck A digitizer with crosshairs, on a graphics tablet. \value PointerDevice.AllDevices Any type of pointing device. + \note Not all platforms are yet able to distinguish mouse and touchpad; and + on those that do, you often want to make mouse and touchpad behavior the same. + \sa QInputDevice::DeviceType */ @@ -338,6 +342,13 @@ void QQuickHoverHandler::setHovered(bool hovered) \sa Qt::CursorShape, QQuickItem::cursor() */ +/*! + \internal + \qmlproperty flags HoverHandler::dragThreshold + + This property is not used in HoverHandler. +*/ + QT_END_NAMESPACE #include "moc_qquickhoverhandler_p.cpp" |