Results 1 to 5 of 5

Thread: QGraphicsView framework performance

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2012
    Location
    UK
    Posts
    17
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QGraphicsView framework performance

    Dear All,

    I am using qt 5.0.1 in windows. I am creating 200k+ custom QGraphicsItem. I have added basic functionalists in these custom items, like mouse hover, mouse click etc.. This items are static. But on top of these items I add some items (200 max) which animates (different property animation, scale, opacity etc).
    When I add those items in the scene it become extremely slow, in a relatively powerful workstation.

    Qt Code:
    1. scene->setSceneRect(0, 0, width, height);
    2. scene->setBackgroundBrush(Qt::darkGray);
    3. scene->setItemIndexMethod(QGraphicsScene::NoIndex);
    4.  
    5. QGraphicsView *view = new QGraphicsView( scene );
    6. view->setRenderHint(QPainter::Antialiasing, false);
    7. view->setResizeAnchor(QGraphicsView::AnchorViewCenter);
    8. view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    9. view->resize( width, height );
    10. view->setOptimizationFlags(QGraphicsView::DontSavePainterState);
    11. view->setViewportUpdateMode( QGraphicsView::SmartViewportUpdate);
    12. view->setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
    13. view->setCacheMode(QGraphicsView::CacheBackground);
    14. view->setViewportUpdateMode( QGraphicsView::FullViewportUpdate);
    15. view->show();
    To copy to clipboard, switch view to plain text mode 

    I have tried the following, but it makes the rendered view extremely bad, as it seems to enable antialiasing, but I need some pixel label precision.

    Qt Code:
    1. view->setViewport(new QGLWidget( QGLFormat()));
    To copy to clipboard, switch view to plain text mode 


    Am I missing some important Qt programming tricks? Please suggest. I can post the code, or explain more if in case please let me know. Thanks in advance.
    Last edited by saifulkhan; 27th March 2013 at 23:13.

Similar Threads

  1. QGraphicsView and animation framework
    By Diph in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2010, 22:22
  2. QgraphicsView performance
    By nileshsince1980 in forum Qt Programming
    Replies: 2
    Last Post: 15th February 2010, 11:54
  3. again QGraphicsView performance
    By medved6 in forum Qt Programming
    Replies: 11
    Last Post: 21st December 2009, 21:11
  4. QGraphicsView performance in 4.6
    By Lodorot in forum Qt Programming
    Replies: 2
    Last Post: 20th September 2009, 23:09
  5. QGraphicsView Framework coordinate mapping problem
    By zgulser in forum Qt Programming
    Replies: 1
    Last Post: 14th September 2009, 12:30

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.