PDA

View Full Version : What's the difference between calling QWidget::update() and QWidget::repaint()?



Momergil
30th May 2014, 17:57
Hello!

In Qwt's QwtPlotCanvas' replot() method, one may either call QWidget::update() or QWidget::repaint() depending on the "immediate paint" configuration.

Is there any significant difference (specially in terms of performance) between using either one of those two methods apart from that QWidget::repaint() does his job immediately while QWidget::update() does not?


Thanks,

Momergil

wysota
30th May 2014, 18:09
repaint() performs an immediate repaint, update() schedules an event. This means that
for(int i=0;i<10;++i) repaint(); will do 10 repaints and
for(int i=0;i<10;++i) update(); will do one repaint.