PDA

View Full Version : restoreOverrideCursor() problem when mouse not moved



sepp
4th August 2006, 14:22
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

Chicken Blood Machine
4th August 2006, 16:51
Do you call your cursor functions in the main thread or the second thread?

sepp
7th August 2006, 07:53
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...

Chicken Blood Machine
7th August 2006, 17:24
You can't call any GUI functions from another thread. You must do the override cursor calls in the main thread.