Handles and processes window events (move, resize) for the Blob animation.
More...
#include <blob_event_handler.h>
|
| void | eventsReEnabled () |
| | Emitted when event processing is re-enabled after being disabled.
|
| |
| void | movementSampleAdded (const QPointF &position, qint64 timestamp) |
| | Emitted periodically during window movement to provide samples for velocity calculation. This signal is emitted less frequently than raw move events but potentially more often than windowMoved.
|
| |
| void | resizeStateRequested () |
| | Emitted during a resize event to request a specific "resizing" state in the Blob animation.
|
| |
| void | significantResizeDetected (const QSize &old_size, const QSize &new_size) |
| | Emitted when a significant resize event is detected after throttling.
|
| |
| void | stateResetTimerRequested () |
| | Emitted after a resize event to request resetting any temporary state timers.
|
| |
| void | windowMoved (const QPointF &new_position, qint64 timestamp) |
| | Emitted when a significant window move event is detected after throttling.
|
| |
|
| bool | AreEventsEnabled () const |
| | Checks if event processing is currently enabled.
|
| |
| | BlobEventHandler (QWidget *parent_widget) |
| | Constructs a BlobEventHandler. Installs an event filter on the parent widget's window.
|
| |
| void | DisableEvents () |
| | Disables event processing. Filtered events will be ignored until EnableEvents() is called.
|
| |
| void | EnableEvents () |
| | Enables event processing. Emits the eventsReEnabled() signal.
|
| |
| bool | eventFilter (QObject *watched, QEvent *event) override |
| | Filters events installed on the parent widget's window. Specifically, intercepts and handles QEvent::Move events via HandleMoveEvent.
|
| |
| bool | IsInTransition () const |
| | Checks if a visual transition is currently marked as in progress.
|
| |
| bool | ProcessResizeEvent (const QResizeEvent *event) |
| | Processes a resize event for the parent widget. Applies throttling and checks for significant size changes before emitting signals.
|
| |
| void | SetTransitionInProgress (const bool inProgress) |
| | Sets the flag indicating whether a visual transition is in progress. When true, event processing might be skipped or handled differently.
|
| |
| | ~BlobEventHandler () override |
| | Destructor. Removes the event filter from the parent widget's window.
|
| |
|
| void | HandleMoveEvent (const QMoveEvent *move_event) |
| | Handles the logic for processing QMoveEvent received by the event filter. Applies throttling based on distance and time delta before emitting signals.
|
| |
|
| QTimer | event_re_enable_timer_ |
| | Timer used for delayed re-enabling of events.
|
| |
| bool | events_enabled_ |
| | Flag indicating whether event processing is currently enabled.
|
| |
| bool | is_resizing_ = false |
| | Flag indicating if the window is currently being resized (used to potentially ignore move events during resize).
|
| |
| qint64 | last_processed_move_time_ |
| | Timestamp (ms since epoch) of the last processed move event.
|
| |
| QPointF | last_processed_position_ |
| | Stores the last window position that was processed after throttling.
|
| |
| QWidget * | parent_widget_ |
| | Pointer to the parent widget whose window events are monitored.
|
| |
| bool | transition_in_progress_ |
| | Flag indicating if a visual transition (e.g., animation) is in progress, potentially suppressing event handling.
|
| |
Handles and processes window events (move, resize) for the Blob animation.
This class filters events for a parent widget's window. It applies throttling and significance checks to avoid excessive processing, especially during rapid movements or resizing. It emits signals when significant events are detected, allowing other components to react appropriately. It also manages to enable/disable event processing, useful during transitions or animations.
◆ BlobEventHandler()
| BlobEventHandler::BlobEventHandler |
( |
QWidget * | parent_widget | ) |
|
|
explicit |
Constructs a BlobEventHandler. Installs an event filter on the parent widget's window.
- Parameters
-
| parent_widget | The widget whose window events will be monitored. |
◆ ~BlobEventHandler()
| BlobEventHandler::~BlobEventHandler |
( |
| ) |
|
|
override |
Destructor. Removes the event filter from the parent widget's window.
◆ AreEventsEnabled()
| bool BlobEventHandler::AreEventsEnabled |
( |
| ) |
const |
|
inline |
Checks if event processing is currently enabled.
- Returns
- True if events are enabled, false otherwise.
◆ DisableEvents()
| void BlobEventHandler::DisableEvents |
( |
| ) |
|
Disables event processing. Filtered events will be ignored until EnableEvents() is called.
◆ EnableEvents()
| void BlobEventHandler::EnableEvents |
( |
| ) |
|
◆ eventFilter()
| bool BlobEventHandler::eventFilter |
( |
QObject * | watched, |
|
|
QEvent * | event ) |
|
override |
Filters events installed on the parent widget's window. Specifically, intercepts and handles QEvent::Move events via HandleMoveEvent.
- Parameters
-
| watched | The object being watched (should be the parent widget's window). |
| event | The event being processed. |
- Returns
- True if the event was handled, false otherwise.
◆ eventsReEnabled
| void BlobEventHandler::eventsReEnabled |
( |
| ) |
|
|
signal |
Emitted when event processing is re-enabled after being disabled.
◆ HandleMoveEvent()
| void BlobEventHandler::HandleMoveEvent |
( |
const QMoveEvent * | move_event | ) |
|
|
private |
Handles the logic for processing QMoveEvent received by the event filter. Applies throttling based on distance and time delta before emitting signals.
- Parameters
-
| move_event | The QMoveEvent to handle. |
◆ IsInTransition()
| bool BlobEventHandler::IsInTransition |
( |
| ) |
const |
|
inline |
Checks if a visual transition is currently marked as in progress.
- Returns
- True if a transition is in progress, false otherwise.
◆ movementSampleAdded
| void BlobEventHandler::movementSampleAdded |
( |
const QPointF & | position, |
|
|
qint64 | timestamp ) |
|
signal |
Emitted periodically during window movement to provide samples for velocity calculation. This signal is emitted less frequently than raw move events but potentially more often than windowMoved.
- Parameters
-
| position | The window position at the time of sampling. |
| timestamp | The timestamp (ms since epoch) of the sample. |
◆ onEventReEnableTimeout
| void BlobEventHandler::onEventReEnableTimeout |
( |
| ) |
|
|
privateslot |
Slot connected to the event_re_enable_timer_'s timeout signal. Calls EnableEvents() to re-enable event processing.
◆ ProcessResizeEvent()
| bool BlobEventHandler::ProcessResizeEvent |
( |
const QResizeEvent * | event | ) |
|
Processes a resize event for the parent widget. Applies throttling and checks for significant size changes before emitting signals.
- Parameters
-
| event | The QResizeEvent received by the parent widget. |
- Returns
- True if the event was considered significant and processed, false otherwise.
◆ resizeStateRequested
| void BlobEventHandler::resizeStateRequested |
( |
| ) |
|
|
signal |
Emitted during a resize event to request a specific "resizing" state in the Blob animation.
◆ SetTransitionInProgress()
| void BlobEventHandler::SetTransitionInProgress |
( |
const bool | inProgress | ) |
|
|
inline |
Sets the flag indicating whether a visual transition is in progress. When true, event processing might be skipped or handled differently.
- Parameters
-
| inProgress | True if a transition is starting, false if it's ending. |
◆ significantResizeDetected
| void BlobEventHandler::significantResizeDetected |
( |
const QSize & | old_size, |
|
|
const QSize & | new_size ) |
|
signal |
Emitted when a significant resize event is detected after throttling.
- Parameters
-
| old_size | The size of the widget before the resize. |
| new_size | The size of the widget after the resize. |
◆ stateResetTimerRequested
| void BlobEventHandler::stateResetTimerRequested |
( |
| ) |
|
|
signal |
Emitted after a resize event to request resetting any temporary state timers.
◆ windowMoved
| void BlobEventHandler::windowMoved |
( |
const QPointF & | new_position, |
|
|
qint64 | timestamp ) |
|
signal |
Emitted when a significant window move event is detected after throttling.
- Parameters
-
| new_position | The new position of the window's top-left corner. |
| timestamp | The timestamp (ms since epoch) when the event was processed. |
◆ event_re_enable_timer_
| QTimer BlobEventHandler::event_re_enable_timer_ |
|
private |
Timer used for delayed re-enabling of events.
◆ events_enabled_
| bool BlobEventHandler::events_enabled_ |
|
private |
Flag indicating whether event processing is currently enabled.
◆ is_resizing_
| bool BlobEventHandler::is_resizing_ = false |
|
private |
Flag indicating if the window is currently being resized (used to potentially ignore move events during resize).
◆ last_processed_move_time_
| qint64 BlobEventHandler::last_processed_move_time_ |
|
private |
Timestamp (ms since epoch) of the last processed move event.
◆ last_processed_position_
| QPointF BlobEventHandler::last_processed_position_ |
|
private |
Stores the last window position that was processed after throttling.
◆ parent_widget_
| QWidget* BlobEventHandler::parent_widget_ |
|
private |
Pointer to the parent widget whose window events are monitored.
◆ transition_in_progress_
| bool BlobEventHandler::transition_in_progress_ |
|
private |
Flag indicating if a visual transition (e.g., animation) is in progress, potentially suppressing event handling.
The documentation for this class was generated from the following files: