PDA

View Full Version : GUI Thread repaint issue



jim.pacyga
6th May 2010, 15:46
Hello,

I've recently noticed in my newly-written Qt application that it seems that the GUI thread will become "stuck" at some points, causing repaints not to happen. For example, when clicking on a QPushButton with a QMenu set, I've noticed that some times the QMenu frame will be painted, but the inside of the menu will not. It isn't until I move the mouse on-screen that the repaint happens, causing the QMenu to be fully visible. I'm not capturing any GUI events at the point where the QMenu is popped-up, so I'm a little baffeled as to why this is happening.

For a little more info, the application is multi-threaded using signals/slots for communication, with the assurance that all GUI code is being called only from the GUI thread. I'm not setting any special flags on my QMainWindow, and have tried many window flags to see if it helps. None of my other threads in the application are blocked, the processor is not pegged, but nothing happens on the GUI thread again until I move the mouse.

However, I have found that for other repaint situations that do not apply to the QMenu drawing, I can set a QTimer on the GUI thread and have a "repaint()" every tick, and things do repaint.

Has anyone had experience with a similar problem??

Thanks in advance!

Developing using:
- Windows XP SP3
- Qt SDK 2010.02.1 (Qt 4.6)

prudhvikodali
23rd June 2010, 03:59
Hi
I am also facing similar probem in windows7 with system context tray menu. Once this happens the system menu does not draw the menu item.
I am doing some background processing in another thread which is not blocking ui thread. But still this is happening.

OS: Windows 7
QT Version : QT4.6