MapDisp::update() vs repaint()

Maria Cruz
  • Maria Cruz

    Maria Cruz - 2003-06-09

    from I noticed "We suggest only using repaint() if you need an immediate repaint, for example during animation. In almost all circumstances update() is better, as it permits Qt to optimize for speed and minimize flicker.

    Warning: If you call repaint() in a function which may itself be called from paintEvent(), you may get infinite recursion. The update() function never causes recursion. "

    And in Qpegps::updateData()  -
    if(d_pViewer->visibleWidget() == mapDisp)  {
           //if (gpsData->mGPSsimLocation.isEmpty() )
           if (tb == mapDisp) { // update moving map


    Why did you use repaint() here?  I tried "update()" and it behaved the same.  I do not know what is better.  Just wondering why you chose repaint().

    • Ralf Haselmeier

      Ralf Haselmeier - 2003-06-10

      I'm not sure. Originally it was update. But as far as I remember there was a problem with the QWidgetStack which is used for the fullscreen mode.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks