Results 1 to 11 of 11

Thread: Performance issue with complex QGraphicsScene

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Location
    Valencia (Spain)
    Posts
    245
    Qt products
    Qt4
    Platforms
    Symbian S60
    Thanks
    38
    Thanked 19 Times in 19 Posts

    Default Re: Performance issue with complex QGraphicsScene

    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

    Qt Code:
    1. 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:

    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QApplication::setGraphicsSystem("raster");
    4. 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.
    Last edited by jano_alex_es; 20th April 2011 at 08:34.

Similar Threads

  1. Performance of scene(QGraphicsScene) with update();
    By mukunda in forum Qt Programming
    Replies: 4
    Last Post: 14th January 2011, 12:21
  2. Performance issue
    By Skorpien126 in forum Qt Programming
    Replies: 4
    Last Post: 2nd July 2010, 16:02
  3. Bad performance of QGraphicsScene
    By miraks in forum Qt Programming
    Replies: 7
    Last Post: 23rd November 2008, 21:41
  4. QGraphicsScene performance
    By Aceman2000 in forum Qt Programming
    Replies: 4
    Last Post: 2nd June 2008, 18:10
  5. QGraphicsScene/QGraphicsView performance problems
    By bnilsson in forum Qt Programming
    Replies: 71
    Last Post: 28th January 2008, 12:08

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.