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.
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:
Member Enumeration Documentation
◆ FilterEventsFlag
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 |
References Gui::WaitCursorP::getInstance(), and Gui::WaitCursorP::ignoreEvents().
◆ restoreCursor()
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().
◆ setIgnoreEvents()
void WaitCursor::setIgnoreEvents | ( | FilterEventsFlags | flags = AllEvents | ) |
◆ setWaitCursor()
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().
The documentation for this class was generated from the following files:
- src/Gui/WaitCursor.h
- src/Gui/WaitCursor.cpp