Results 1 to 4 of 4

Thread: restoreOverrideCursor() problem when mouse not moved

  1. #1
    Join Date
    Feb 2006
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default restoreOverrideCursor() problem when mouse not moved

    Hi all,

    i have a qt 4.1.1 gui and some lengthy tasks done in a separate thread. when the thread starts, it calls QApplication::setOverrideCursor(Qt:WaitCursor), when is goes to sleep, it calls QApplication::restoreOverrideCursor().

    this almost works: when setOverrideCursor() is called, the hour glass cursor is shown, when restoreOverrideCursor() is called *and* the mouse is moved afterwards, the arrow cursor is shown. however, if i don't move the mouse, the hour glass cursor stays, which is not fine...

    platfom is win32.

    any suggestions?

    thanks in advance

    sepp

  2. #2
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: restoreOverrideCursor() problem when mouse not moved

    Do you call your cursor functions in the main thread or the second thread?
    Save yourself some pain. Learn C++ before learning Qt.

  3. #3
    Join Date
    Feb 2006
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: restoreOverrideCursor() problem when mouse not moved

    i call them in the 2nd thread.

    i had a prior version which called the cursor functions in main thread slots, which where in turn called by signals from the 2nd thread via queued connections. anyway, this very often lead to a 'corrupt' override cursor stack, that is, there where more push than pop operations on the stack, so the wait cursor stayed in the end...

  4. #4
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: restoreOverrideCursor() problem when mouse not moved

    You can't call any GUI functions from another thread. You must do the override cursor calls in the main thread.
    Save yourself some pain. Learn C++ before learning Qt.

Similar Threads

  1. Replies: 2
    Last Post: 24th July 2006, 18:36
  2. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 19:25
  3. setCanvas blocks mouse movement on QtCanvasView
    By YuriyRusinov in forum Qt Programming
    Replies: 8
    Last Post: 20th April 2006, 07:38
  4. Forwarding mouse events to another widget.
    By yogeshm02 in forum Qt Programming
    Replies: 8
    Last Post: 28th February 2006, 13:25
  5. Clearing a QLabel since the mouse position
    By SkripT in forum Qt Programming
    Replies: 10
    Last Post: 18th January 2006, 18:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.