Check cursor State
-
wrote on 30 Mar 2012, 12:07 last edited by
i am setting cursor state by QApplication::setOverrideCursor( Qt::WaitCursor );
but i have to check whether the cursor is in normal form of not and then i have to call
QApplication::restoreOverrideCursor();
how can i check?if ( ? )
QApplication::restoreOverrideCursor(); -
wrote on 30 Mar 2012, 12:23 last edited by
[[doc:QApplication]] takes care of that for you. It keeps an internal stack. All you need to do, is make sure that your number of setOverrideCursor calls matches the number of your restoreOverrideCursor calls.
from the docs:
[quote]Application cursors are stored on an internal stack. setOverrideCursor() pushes the cursor onto the stack, and restoreOverrideCursor() pops the active cursor off the stack. changeOverrideCursor() changes the curently active application override cursor.Every setOverrideCursor() must eventually be followed by a corresponding restoreOverrideCursor(), otherwise the stack will never be emptied.[/quote]
-
wrote on 30 Mar 2012, 12:30 last edited by
in our project .exe is setting cursor but our plugins after loading has to restore that so it is not possibe?
-
wrote on 30 Mar 2012, 12:36 last edited by
I don't quite get the requirement.
-
wrote on 30 Mar 2012, 12:54 last edited by
We have project called OrderXpress
in our project we use two plugins photoXpress and AlbumXpress
we load these plugins through container and setting cursor to wait state but in plugins
it internally setting cursor for differnt modes so how can i identify the cursor state to restore it in plugins as our plugins did not have the knowledge of our container. -
wrote on 30 Mar 2012, 12:58 last edited by
They don't need that knowledge. If they set their own cursor override, they should re-set it as well. The same goes for the container: if it sets the override, it should reset it as well.
It's a good candidate for a RAII class, by the way.
-
wrote on 30 Mar 2012, 13:01 last edited by
Thanks sir.
By the way which country u belongs to? -
wrote on 30 Mar 2012, 13:02 last edited by
[quote author="neeraj2012" date="1333112470"]Thanks sir.
By the way which country u belongs to?
[/quote]
Check my profile by clicking on my name next to my picture :-) -
wrote on 30 Mar 2012, 13:06 last edited by
Got it , its my pleasure to have you sir .Thanks for your precious time but i will be available with my Questions so please guide me.
1/9