aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2019-08-26 14:39:04 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2019-08-26 22:25:51 +0200
commit0ec16fb93db6ad6792b3269838211485e8af464b (patch)
tree5221789dff275820400e410acf28b1921282c3bb
parent4b944cb61fb3ceee2f1b743823e4a83b686bafd6 (diff)
Add missing HoverHandler docs
It was intended to inherit most of the docs from SinglePointHandler; but the hovered property is unique. Task-number: QTBUG-68072 Change-Id: I4b49569c9966b9252a61e40e8b07ef98f34849a4 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
-rw-r--r--src/quick/handlers/qquickhoverhandler.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/quick/handlers/qquickhoverhandler.cpp b/src/quick/handlers/qquickhoverhandler.cpp
index bdcd5dc4cc..6391fb2958 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) {