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... | |
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.
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:
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 | ( | ) |
Restores the last cursor again.
References Gui::WaitCursorP::getInstance(), restoreCursor(), and Gui::WaitCursorP::setIgnoreEvents().
WaitCursor::FilterEventsFlags WaitCursor::ignoreEvents | ( | ) | const |
References Gui::WaitCursorP::getInstance(), and Gui::WaitCursorP::ignoreEvents().
void WaitCursor::restoreCursor | ( | ) |
Restores the last cursor if needed.
References Gui::WaitCursorP::getInstance(), and Gui::WaitCursorP::setBusy().
Referenced by FemGui::TaskDlgMeshShapeNetgen::accept(), RobotGui::Workbench::activated(), Gui::Application::activateWorkbench(), Gui::Application::exportTo(), Gui::Application::importFrom(), Gui::Application::open(), Gui::SequencerBar::pause(), Gui::Application::sShowPreferences(), TechDrawGui::TaskProjGroup::viewToggled(), and ~WaitCursor().
void WaitCursor::setIgnoreEvents | ( | FilterEventsFlags | flags = AllEvents | ) |
void WaitCursor::setWaitCursor | ( | ) |
Sets the wait cursor if needed.
References Gui::WaitCursorP::getInstance(), and Gui::WaitCursorP::setBusy().
Referenced by RobotGui::Workbench::activated(), Gui::Application::activateWorkbench(), Gui::Application::exportTo(), Gui::Application::importFrom(), Gui::Application::open(), Gui::SequencerBar::resume(), Gui::Application::sShowPreferences(), and WaitCursor().