![]() |
NDEVR
API Documentation
|
Handles scrolling or flicking within the application. More...
Public Member Functions | |
| ScrollGesture (QAbstractScrollArea *target) | |
| Constructs a ScrollGesture attached to the given scroll area. | |
| bool | eventFilter (QObject *, QEvent *) override |
| Filters events for the target object to intercept mouse gestures for scrolling. | |
| bool | handleMouseMove (QEvent *event, QPoint location) |
| Handles the mouse move event to continue tracking a scroll gesture. | |
| bool | handleMousePress (QEvent *event, QPoint location) |
| Handles the mouse press event to begin tracking a potential scroll gesture. | |
| bool | handleMouseRelease (QEvent *event, QPoint location) |
| Handles the mouse release event to finalize a scroll gesture and apply flick momentum. | |
| void | setAcceptMouseClick (QWidget *target) |
| Configures a widget to accept mouse click events that originate from the scroll gesture. | |
| void | setScrollOffset (QPoint point) |
| Sets the current scroll offset of the target scroll area. | |
| void | setThreshold (int threshold) |
| Sets the minimum pixel distance required before a drag is recognized as a scroll gesture. | |
| int | threshold () const |
| Returns the minimum pixel distance required before a drag is recognized as a scroll gesture. | |
Handles scrolling or flicking within the application.
Provides kinetic scrolling behavior for QAbstractScrollArea widgets by tracking mouse press, move, and release events and applying momentum-based flick gestures.
Definition at line 48 of file ScrollGesture.h.
| ScrollGesture::ScrollGesture | ( | QAbstractScrollArea * | target | ) |
Constructs a ScrollGesture attached to the given scroll area.
| [in] | target | The scroll area widget that will receive scroll gesture behavior. |
References ScrollGesture().
Referenced by ScrollGesture().
|
override |
Filters events for the target object to intercept mouse gestures for scrolling.
| [in] | object | The object receiving the event. |
| [in] | event | The event to filter. |
| bool ScrollGesture::handleMouseMove | ( | QEvent * | event, |
| QPoint | location ) |
Handles the mouse move event to continue tracking a scroll gesture.
| [in] | event | The mouse move event. |
| [in] | location | The current position of the cursor in widget coordinates. |
| bool ScrollGesture::handleMousePress | ( | QEvent * | event, |
| QPoint | location ) |
Handles the mouse press event to begin tracking a potential scroll gesture.
| [in] | event | The mouse press event. |
| [in] | location | The position of the press in widget coordinates. |
| bool ScrollGesture::handleMouseRelease | ( | QEvent * | event, |
| QPoint | location ) |
Handles the mouse release event to finalize a scroll gesture and apply flick momentum.
| [in] | event | The mouse release event. |
| [in] | location | The position of the release in widget coordinates. |
| void ScrollGesture::setAcceptMouseClick | ( | QWidget * | target | ) |
Configures a widget to accept mouse click events that originate from the scroll gesture.
| [in] | target | The widget that should accept mouse click events. |
| void ScrollGesture::setScrollOffset | ( | QPoint | point | ) |
Sets the current scroll offset of the target scroll area.
| [in] | point | The scroll offset to apply. |
| void ScrollGesture::setThreshold | ( | int | threshold | ) |
Sets the minimum pixel distance required before a drag is recognized as a scroll gesture.
| [in] | threshold | The distance threshold in pixels. |
References threshold().
| int ScrollGesture::threshold | ( | ) | const |
Returns the minimum pixel distance required before a drag is recognized as a scroll gesture.
Referenced by setThreshold().