I suppose it's because Qt is able to sort between displayed items and not displayed items and draw only what's useful (if it's indeed the reason, that's a shame that QGLWidget do not support partial updates; that'd solve our problem here, I guess).
If you are using a QGLWidget to render
setViewport(new QGLWidget)
To copy to clipboard, switch view to plain text mode
don't forget to set "fullviewportupdate".
By commenting out my line setting a QGLWidget as the viewport of my QGraphicsView. Was I wrong when supposing the raster engine was the default one?
It depends on the platform, but in order to be sure, try:
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
QApplication::setGraphicsSystem("raster");
QApplication a(argc, argv);
To copy to clipboard, switch view to plain text mode
Its a HUGE performance improvement. At least in my case.
Background is done is scene coordinates so moving the view around the scene doesn't invalidate the background cache (I think).
I though so... but it does. Caching the background is a good option if the viewport is static. When the viewport moves the big pixmap is loaded again on cache, taking too much time.
In my opinion this video is a must if you are trying to develop a videogame with the QGraphicsView system. And if you want to have it for a mobile device (and OVI store, where Qt4.7 with QGLWidget for Symbian is still not accepted)
http://qt.nokia.com/developer/learni...view-in-depth/
Those are the improvements I'm using, so far.
Bookmarks