1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/
19 #include "SUIT_OverrideCursor.h"
21 /*!Constructor. Initialize wait cursor.*/
22 SUIT_OverrideCursor::SUIT_OverrideCursor()
24 QApplication::setOverrideCursor( QCursor( Qt::WaitCursor ) );
27 /*!Copy constructor.*/
28 SUIT_OverrideCursor::SUIT_OverrideCursor( const QCursor& cursor )
30 QApplication::setOverrideCursor( cursor );
33 /*!Destructor. restoring override cursor.*/
34 SUIT_OverrideCursor::~SUIT_OverrideCursor()
36 QApplication::restoreOverrideCursor();
39 /*! Check cursors is empty */
40 bool SUIT_OverrideCursor::isActive() const
42 return myCursors.isEmpty();
46 void SUIT_OverrideCursor::suspend()
51 while ( QApplication::overrideCursor() )
53 myCursors.prepend( *QApplication::overrideCursor() );
54 QApplication::restoreOverrideCursor();
59 void SUIT_OverrideCursor::resume()
64 for ( QValueList<QCursor>::const_iterator it = myCursors.begin(); it != myCursors.end(); ++it )
65 QApplication::setOverrideCursor( *it );