Gui::WaitCursor Class Reference

This class sets a waitcursor automatically while a slow operation is running. More...

#include <WaitCursor.h>

Public Types

enum  FilterEventsFlag { NoEvents = 0x00 , KeyEvents = 0x01 , MouseEvents = 0x02 , AllEvents = KeyEvents | MouseEvents }
 

Public Member Functions

FilterEventsFlags ignoreEvents () const
 
void restoreCursor ()
 Restores the last cursor if needed. More...
 
void setIgnoreEvents (FilterEventsFlags flags=AllEvents)
 
void setWaitCursor ()
 Sets the wait cursor if needed. More...
 
 WaitCursor ()
 Constructs this object and shows the wait cursor immediately. More...
 
 ~WaitCursor ()
 Restores the last cursor again. More...
 

Detailed Description

This class sets a waitcursor automatically while a slow operation is running.

Therefore you just have to create an instance of WaitCursor before the time consuming operation starts.

:
...
... // slow operation
...

Sometimes you have two slow operations with some user interactions in between them. Avoiding to show the waiting cursor then you have to call the methods restoreCursor() and setWaitCursor manually, like:

:
...
... // 1st slow operation
...
... // some dialog stuff
...
... // 2nd slow operation
Author
Werner Mayer

Member Enumeration Documentation

◆ FilterEventsFlag

Enumerator
NoEvents 
KeyEvents 
MouseEvents 
AllEvents 

Constructor & Destructor Documentation

◆ WaitCursor()

WaitCursor::WaitCursor ( )

Constructs this object and shows the wait cursor immediately.

If you need to open a dialog as long as an instance of WaitCursor exists you must call restoreCursor() before and setWaitCursor() afterwards because all key events and mouse button events are filtered, otherwise you will run into strange behaviour.

References Gui::WaitCursorP::getInstance(), Gui::WaitCursorP::ignoreEvents(), and setWaitCursor().

◆ ~WaitCursor()

WaitCursor::~WaitCursor ( )

Restores the last cursor again.

References Gui::WaitCursorP::getInstance(), restoreCursor(), and Gui::WaitCursorP::setIgnoreEvents().

Member Function Documentation

◆ ignoreEvents()

WaitCursor::FilterEventsFlags WaitCursor::ignoreEvents ( ) const

◆ restoreCursor()

◆ setIgnoreEvents()

◆ setWaitCursor()


The documentation for this class was generated from the following files: