PDA

View Full Version : repaint issue in qt4



ancest
11th March 2009, 12:56
Hai friends,
I have a problem in qt4.4 QWizardPage. i am writing a program which checks something when next button is pressed(of QWizard page ). So validatePage() function will be called.
The validatePage() takes some time to check and its results will be displayed in a QTextEdit.
But the problem is that whenever some window moves over it(at the time when validatePage() is running ) , whatever displayed on it will gets lost or get blurred.
I want to avoid such repaint issues such that whenever something overlaps it or moves over it, its display still have to be in the same condition as before.
I tried several methods including a timer which is activated periodically and it will repaint the QWizardPage but it is not working because after validatePage gets activated nothing can repaint the window. Only after validatePage() is over that we can do anything to window.
This is a general problem such that if any function is working in qt4, we cannot repaint the window when its display is overwritten by some other windows. Only after its execution that we can repaint the window
I want a solution to repaint window whenever its display gets damaged due to repaint

I searched google but i cannot find anything useful. Any help will be deeply appreciated

wysota
11th March 2009, 14:39
You are starving the event loop. Read this article to see how to avoid it:
http://doc.trolltech.com/qq/qq27-responsive-guis.html

ancest
12th March 2009, 10:51
Thanks wysota for your help. That note was very much helpful and interesting.
According to my problem i am now using a worker thread to do my function. So the repaint issue will be handled automatically by the main gui application