Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Essentially what Reto said, with the following additional considerations:</p> <ol> <li><p>PaintDevices that you can use as the cache: <a href="http://qt-project.org/doc/qt-4.8/qpaintdevice.html" rel="nofollow">http://qt-project.org/doc/qt-4.8/qpaintdevice.html</a> lists the possible options of the paintDevices that can be painted to using QPainter. The ones you are looking for are probably: QImage, QPixmap, QPicture and even the OpenGL related PaintDevices, in case you are using hardware accelerated widgets. QImage is recommended in case you are going to perform a <a href="http://gamedev.tutsplus.com/articles/glossary/quick-tip-what-is-blitting/" rel="nofollow">blit</a>, and need direct pixel data access but, otherwise, for simple QPainter operations, QPixMap is <a href="http://qt-project.org/doc/qt-4.8/qpixmap.html" rel="nofollow">faster</a>. </p></li> <li><p>Actually painting the new points from cache that you've got: Have a look at the relevant draw{Image/Picture/Pixmap} api's of <a href="http://qt-project.org/doc/qt-4.8/qpainter.html" rel="nofollow">QPainter</a>, that you can use to draw the PaintDevice that you have cached onto in the first place. Use the <a href="http://qt-project.org/doc/qt-4.8/qpaintevent.html#region" rel="nofollow">QPaintEvent::region</a> from the paintEvent obtained in the paintEvent call of the widget to get the rectangle that you need to copy over from the cache, keeping in mind that, if you are sending update requests yourself, use the <a href="http://qt-project.org/doc/qt-4.8/qwidget.html#update-2" rel="nofollow">appropriate</a> update function to trigger the paintEvent.</p></li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload