diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2022-03-21 11:21:09 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-06-04 13:26:24 +0000 |
commit | 9a3eebfb66a78a5e4768d3f62d9ecd24911f2f02 (patch) | |
tree | 9c6cf9ef779343c0e519928e779868cbfb7c7e2b /src/quick/handlers/qquickhoverhandler.cpp | |
parent | 8dbb0dc99851dcd79e901780da5a7189c657e8ea (diff) |
doc: Fix inherited property docs in HoverHandler
Some base class snippets use TapHandler, but it's better to show
snippets specifically with HoverHandler. These snippets are also
runnable and thus testable.
Fixes: QTBUG-95395
Task-number: QTBUG-101932
Change-Id: Ibcdc30ff8a785a3651177c79522332cf09c3013c
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
(cherry picked from commit a76ad7ef6a87af074612897ea6df30167ebe698e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick/handlers/qquickhoverhandler.cpp')
-rw-r--r-- | src/quick/handlers/qquickhoverhandler.cpp | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/src/quick/handlers/qquickhoverhandler.cpp b/src/quick/handlers/qquickhoverhandler.cpp index d94a0466bf..1be7f5a4c0 100644 --- a/src/quick/handlers/qquickhoverhandler.cpp +++ b/src/quick/handlers/qquickhoverhandler.cpp @@ -165,6 +165,98 @@ void QQuickHoverHandler::setHovered(bool hovered) } /*! + \internal + \qmlproperty flags QtQuick::HoverHandler::acceptedButtons + + This property is not used in HoverHandler. +*/ + +/*! + \qmlproperty flags QtQuick::HoverHandler::acceptedDevices + + The types of pointing devices that can activate the pointer handler. + + By default, this property is set to + \l{QInputDevice::DeviceType}{PointerDevice.AllDevices}. + If you set it to an OR combination of device types, it will ignore pointer + events from the non-matching devices. + + For example, an item could be made to respond to mouse hover in one way, + and stylus hover in another way, with two handlers: + + \snippet pointerHandlers/hoverMouseOrStylus.qml 0 + + The available device types are as follows: + + \value PointerDevice.Mouse A mouse. + \value PointerDevice.TouchScreen A touchscreen. + \value PointerDevice.TouchPad A touchpad or trackpad. + \value PointerDevice.Stylus A stylus on a graphics tablet. + \value PointerDevice.Airbrush An airbrush on a graphics tablet. + \value PointerDevice.Puck A digitizer with crosshairs, on a graphics tablet. + \value PointerDevice.AllDevices Any type of pointing device. + + \sa QInputDevice::DeviceType +*/ + +/*! + \qmlproperty flags QtQuick::HoverHandler::acceptedPointerTypes + + The types of pointing instruments (generic, stylus, eraser, and so on) + that can activate the pointer handler. + + By default, this property is set to + \l {QPointingDevice::PointerType} {PointerDevice.AllPointerTypes}. + If you set it to an OR combination of device types, it will ignore events + from non-matching events. + + For example, you could provide feedback by changing the cursor depending on + whether a stylus or eraser is hovering over a graphics tablet: + + \snippet pointerHandlers/hoverStylusOrEraser.qml 0 + + The available pointer types are as follows: + + \value PointerDevice.Generic A mouse or a device that emulates a mouse. + \value PointerDevice.Finger A finger on a touchscreen (hover detection is unlikely). + \value PointerDevice.Pen A stylus on a graphics tablet. + \value PointerDevice.Eraser An eraser on a graphics tablet. + \value PointerDevice.Cursor A digitizer with crosshairs, on a graphics tablet. + \value PointerDevice.AllPointerTypes Any type of pointing device. + + \sa QPointingDevice::PointerType +*/ + +/*! + \qmlproperty flags QtQuick::HoverHandler::acceptedModifiers + + If this property is set, a hover event is handled only if the given keyboard + modifiers are pressed. The event is ignored without the modifiers. + + This property is set to \c Qt.KeyboardModifierMask by default, resulting + in handling hover events regardless of any modifier keys. + + For example, an \l[QML]{Item} could have two handlers of the same type, one + of which is enabled only if the required keyboard modifiers are pressed: + + \snippet pointerHandlers/hoverModifiers.qml 0 + + The available modifiers are as follows: + + \value Qt.NoModifier No modifier key is allowed. + \value Qt.ShiftModifier A Shift key on the keyboard must be pressed. + \value Qt.ControlModifier A Ctrl key on the keyboard must be pressed. + \value Qt.AltModifier An Alt key on the keyboard must be pressed. + \value Qt.MetaModifier A Meta key on the keyboard must be pressed. + \value Qt.KeypadModifier A keypad button must be pressed. + \value Qt.GroupSwitchModifier A Mode_switch key on the keyboard must be pressed. + X11 only (unless activated on Windows by a command line argument). + \value Qt.KeyboardModifierMask The handler ignores modifier keys. + + \sa Qt::KeyboardModifier +*/ + +/*! \since 5.15 \qmlproperty Qt::CursorShape QtQuick::HoverHandler::cursorShape This property holds the cursor shape that will appear whenever |