diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-08-28 07:34:06 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-08-28 07:34:06 +0200 |
commit | f6ab93a9f96b163cb82f4a2c0971d4fd5cc81fb4 (patch) | |
tree | a4f77a581a2ac38ff1617d046c8c37abc741a117 /src/quick/handlers/qquickhoverhandler.cpp | |
parent | 0ae01dec7aa0ffbb59e6e947bfa2e73ae030346a (diff) | |
parent | 8577f12bf4dfd9adfe8c5b85a3712bf1cc5ba0c3 (diff) | |
download | qtdeclarative-f6ab93a9f96b163cb82f4a2c0971d4fd5cc81fb4.tar.gz |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I0ae0a162e133cffd8fb1a2c6b70826e50f06facd
Diffstat (limited to 'src/quick/handlers/qquickhoverhandler.cpp')
-rw-r--r-- | src/quick/handlers/qquickhoverhandler.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/quick/handlers/qquickhoverhandler.cpp b/src/quick/handlers/qquickhoverhandler.cpp index d7566f0cd8..a6325e084b 100644 --- a/src/quick/handlers/qquickhoverhandler.cpp +++ b/src/quick/handlers/qquickhoverhandler.cpp @@ -47,14 +47,24 @@ Q_LOGGING_CATEGORY(lcHoverHandler, "qt.quick.handler.hover") /*! \qmltype HoverHandler \instantiates QQuickHoverHandler + \inherits SinglePointHandler \inqmlmodule QtQuick \ingroup qtquick-input-handlers \brief Handler for mouse and tablet hover. - HoverHandler detects a hovering cursor. Since touchscreens don't generally - offer hover events, in practice it detects a hovering mouse or tablet stylus. + HoverHandler detects a hovering mouse or tablet stylus cursor. - \sa MouseArea + A binding to the \l hovered property is the easiest way to react when the + cursor enters or leaves the \l {PointerHandler::parent}{parent} Item. + The \l {SinglePointHandler::point}{point} property provides more detail, + including the cursor position. The + \l {PointerDeviceHandler::acceptedDevices}{acceptedDevices}, + \l {PointerDeviceHandler::acceptedPointerTypes}{acceptedPointerTypes}, + and \l {PointerDeviceHandler::acceptedModifiers}{acceptedModifiers} + properties can be used to narrow the behavior to detect hovering of + specific kinds of devices or while holding a modifier key. + + \sa MouseArea, PointHandler */ QQuickHoverHandler::QQuickHoverHandler(QQuickItem *parent) @@ -97,6 +107,14 @@ void QQuickHoverHandler::handleEventPoint(QQuickEventPoint *point) setPassiveGrab(point); } +/*! + \qmlproperty bool QtQuick::HoverHandler::hovered + \readonly + + Holds true whenever any pointing device cursor (mouse or tablet) is within + the bounds of the \c parent Item, extended by the + \l {PointerHandler::margin}{margin}, if any. +*/ void QQuickHoverHandler::setHovered(bool hovered) { if (m_hovered != hovered) { |