Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Check cursor State
Forum Updated to NodeBB v4.3 + New Features

Check cursor State

Scheduled Pinned Locked Moved General and Desktop
9 Posts 2 Posters 3.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    neeraj2012
    wrote on 30 Mar 2012, 12:07 last edited by
    #1

    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();

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on 30 Mar 2012, 12:23 last edited by
      #2

      [[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]

      1 Reply Last reply
      0
      • N Offline
        N Offline
        neeraj2012
        wrote on 30 Mar 2012, 12:30 last edited by
        #3

        in our project .exe is setting cursor but our plugins after loading has to restore that so it is not possibe?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on 30 Mar 2012, 12:36 last edited by
          #4

          I don't quite get the requirement.

          1 Reply Last reply
          0
          • N Offline
            N Offline
            neeraj2012
            wrote on 30 Mar 2012, 12:54 last edited by
            #5

            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.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on 30 Mar 2012, 12:58 last edited by
              #6

              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.

              1 Reply Last reply
              0
              • N Offline
                N Offline
                neeraj2012
                wrote on 30 Mar 2012, 13:01 last edited by
                #7

                Thanks sir.
                By the way which country u belongs to?

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on 30 Mar 2012, 13:02 last edited by
                  #8

                  [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 :-)

                  1 Reply Last reply
                  0
                  • N Offline
                    N Offline
                    neeraj2012
                    wrote on 30 Mar 2012, 13:06 last edited by
                    #9

                    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 Reply Last reply
                    0

                    1/9

                    30 Mar 2012, 12:07

                    • Login

                    • Login or register to search.
                    1 out of 9
                    • First post
                      1/9
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved