Menu

MapDisp::update() vs repaint()

Help
Maria Cruz
2003-06-09
2003-06-10
  • Maria Cruz

    Maria Cruz - 2003-06-09

    from http://doc.trolltech.com/3.1/qwidget.html 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)  {
           d_pViewer->visibleWidget()->repaint();
           //if (gpsData->mGPSsimLocation.isEmpty() )
            //d_pViewer->visibleWidget()->update();
        }
        else
        {
           if (tb == mapDisp) { // update moving map
              mapDisp->repaint();

    etc.

    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().
    Thanks.

     
    • 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.

       

Log in to post a comment.