Salome HOME
NRI : Temporary modification for reading catalog of modules.
[modules/kernel.git] / src / SALOMEGUI / QAD_WaitCursor.h
1 //  File      : QAD_WaitCursor.h
2 //  Created   : 02/10/2002
3 //  Descr     : Use this class to set wait cursor on long operatins
4
5 //  Author    : Vadim SANDLER
6 //  Project   : SALOME Pro
7 //  Module    : SALOMEGUI 
8 //  Copyright : Open CASCADE
9 //  $Header$
10
11 #ifndef QAD_WAITCURSOR_H
12 #define QAD_WAITCURSOR_H
13
14 #include <qapplication.h>
15 #include "QAD.h"
16
17 class QAD_EXPORT QAD_WaitCursor {
18  public:
19 // constructor
20      QAD_WaitCursor() : myStarted(false) { start(); }
21 // destructor
22      ~QAD_WaitCursor()   { stop();  }
23
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; }
30
31  private:
32      bool  myStarted;
33 };
34
35 #endif