1 // File : QAD_WaitCursor.h
2 // Created : 02/10/2002
3 // Descr : Use this class to set wait cursor on long operatins
5 // Author : Vadim SANDLER
6 // Project : SALOME Pro
8 // Copyright : Open CASCADE
11 #ifndef QAD_WAITCURSOR_H
12 #define QAD_WAITCURSOR_H
14 #include <qapplication.h>
17 class QAD_EXPORT QAD_WaitCursor {
20 QAD_WaitCursor() : myStarted(false) { start(); }
22 ~QAD_WaitCursor() { stop(); }
24 // sets WAIT cursor if not set yet
25 void start() { if (!myStarted) { QApplication::setOverrideCursor(Qt::waitCursor); myStarted = true; } }
26 // clears WAIT cursor if set
27 void stop() { if (myStarted) { QApplication::restoreOverrideCursor(); myStarted = false; } }
28 // returns true if WAIT cursor is active
29 bool isStarted() { return myStarted; }