PDA

View Full Version : repaint widget



yxtx1984
10th March 2010, 11:41
What happened when call repaint()? I think it will jump to paintEvent immediately, is it right? if not, how to force the widget repaint itself immediately?

In my case, the application will not go to paintEvent immediately after repaint() or update() is called, so some fraction problem is happened.
Is it a way to force the widget repaint immeiately but not to called later.

Thanks!

halmassi
10th March 2010, 12:03
what kind of problems do you have

aamer4yu
10th March 2010, 12:18
How long does it take to get in paintEvent after you call update() or repaint() ??
Usually the paintEvent will be called in next event loop iteration, but it shouldnt be slow..you must be performing some length actions I suppose..

yxtx1984
11th March 2010, 01:42
By the way, the program is run on the Max OS, not windows.
As to repaint(), Is something difference with different OS?

yxtx1984
11th March 2010, 03:51
THis is my codes, the ForceRepaintAll will be called several times by signals sent by another widget when the mouseMove event happen.
void CVxTlTrackWidget::ForceRepaintAll()
{
int oldTempDraw = m_isTempDraw;
m_isTempDraw = false;
repaint();
m_isTempDraw = oldTempDraw;
}

in windows, it will go to paintEvent immediately after repaint() has run, and then go to next line: m_isTempDraw = oldTempDraw.
But in MacOS, It's different, it just go to next line of repaint(), (m_isTempDraw = oldTempDraw), and then go to the paintEvent.