QmlMaterial 0.1.0
|
Handles scrolling for a Flickable and 2 attached ScrollBars. More...
#include <qml_material/kirigami/wheelhandler.h>
Signals | |
void | wheel (KirigamiWheelEvent *wheel) |
This signal is emitted when a wheel event reaches the event filter, just before scrolling is handled. | |
Properties | |
QQuickItem * | target |
This property holds the Qt Quick Flickable that the WheelHandler will control. | |
qreal | verticalStepSize |
This property holds the vertical step size. | |
qreal | horizontalStepSize |
This property holds the horizontal step size. | |
Qt::KeyboardModifiers | pageScrollModifiers |
This property holds the keyboard modifiers that will be used to start page scrolling. | |
bool | filterMouseEvents |
This property holds whether the WheelHandler filters mouse events like a Qt Quick Controls ScrollView would. | |
bool | keyNavigationEnabled |
This property holds whether the WheelHandler handles keyboard scrolling. | |
bool | blockTargetWheel |
This property holds whether the WheelHandler blocks all wheel events from reaching the Flickable. | |
bool | scrollFlickableTarget |
This property holds whether the WheelHandler can use wheel events to scroll the Flickable. | |
Handles scrolling for a Flickable and 2 attached ScrollBars.
WheelHandler filters events from a Flickable, a vertical ScrollBar and a horizontal ScrollBar. Wheel and KeyPress events (when keyNavigationEnabled
is true) are used to scroll the Flickable. When filterMouseEvents
is true, WheelHandler blocks mouse button input from reaching the Flickable and sets the interactive
property of the scrollbars to false when touch input is used.
Wheel event handling behavior:
verticalStepSize
and horizontalStepSize
.pageScrollModifiers
is used, scroll by pages.verticalStepSize
, horizontalStepSize
and page increments (if using page scrolling) will be multiplied by angle delta / 120
to keep scrolling smooth.Common usage with a Flickable:
Common usage inside of a ScrollView template:
|
signal |
This signal is emitted when a wheel event reaches the event filter, just before scrolling is handled.
Accepting the wheel event in the onWheel
signal handler prevents scrolling from happening.
bool WheelHandler::blockTargetWheel |
This property holds whether the WheelHandler blocks all wheel events from reaching the Flickable.
When this property is false, scrolling the Flickable with WheelHandler will only block an event from reaching the Flickable if the Flickable is actually scrolled by WheelHandler.
NOTE: Wheel events created by touchpad gestures with pixel deltas will always be accepted no matter what. This is because they will cause the Flickable to jump back to where scrolling started unless the events are always accepted before they reach the Flickable.
The default value is true.
|
readwrite |
This property holds whether the WheelHandler filters mouse events like a Qt Quick Controls ScrollView would.
Touch events are allowed to flick the view and they make the scrollbars not interactive.
Mouse events are not allowed to flick the view and they make the scrollbars interactive.
Hover events on the scrollbars and wheel events on anything also make the scrollbars interactive when this property is set to true.
The default value is false
.
|
readwrite |
This property holds the horizontal step size.
The default value is equivalent to 20 * Qt.styleHints.wheelScrollLines
. This is consistent with the default increment for QScrollArea.
|
readwrite |
This property holds whether the WheelHandler handles keyboard scrolling.
The default value is false
.
|
read |
This property holds the keyboard modifiers that will be used to start page scrolling.
The default value is equivalent to Qt.ControlModifier | Qt.ShiftModifier
. This matches QScrollBar, which uses QAbstractSlider behavior.
bool WheelHandler::scrollFlickableTarget |
This property holds whether the WheelHandler can use wheel events to scroll the Flickable.
The default value is true.
|
readwrite |
This property holds the vertical step size.
The default value is equivalent to 20 * Qt.styleHints.wheelScrollLines
. This is consistent with the default increment for QScrollArea.