Results 1 to 10 of 10

Thread: QGraphicsScene performance (200000 static items and 1 moving)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QGraphicsScene performance (200000 static items and 1 moving)

    Hello. I'm making cad-like software. It is for temperature field modeling and visulization. User will work with MANY blocks here. It can be 10000, it can be 10000 or more.

    I obviously use Graphics Scene engine for it. Each block is QGraphicsItem.

    Also I have 1 item there — Anchor. It follows cursor. It is done by signal (from view)l/slot (in Anchor). Slot makes setPos().

    The problem is that setPos() sometimes results in scene reindexing. It is slow, when there is many items.

    I'm thinking about moving that moving item to view (make it as widget there). Any better solution?

    Screenshot discribing why I need many blocks (not so many blocks here): http://obey.su/upload/11-01-23_LOR_QFrost/qfrost2.png
    Last edited by Obey-Kun; 27th January 2011 at 16:38.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QGraphicsScene performance (200000 static items and 1 moving)

    There are several options coming in my mind: disable indexing or "play around" with the various performance tunings the view and scene offers: level of detail, update mode...

    Further (please attach images to the forum, that the post stays valid) it seems that you are composing a grid out of items, and your anchor "frames" one item. If so, skip the anchor, and alter the paint method of your items to draw the focus frame itself. To move the anchor, unset the "highlight frame" from the current one and set it to the other.

  3. #3
    Join Date
    Dec 2009
    Posts
    128
    Thanks
    7
    Thanked 14 Times in 14 Posts
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsScene performance (200000 static items and 1 moving)

    Maybe I'm wrong but your app makes me think of the Pixelator example (in case you're interested)

Similar Threads

  1. Garbled marks when moving items in QGraphicsScene
    By extralucas in forum Qt Programming
    Replies: 2
    Last Post: 4th December 2010, 22:23
  2. Moving QGraphicsScene to Left or Right firections
    By augusbas in forum Qt Programming
    Replies: 2
    Last Post: 30th June 2010, 04:45
  3. QGraphicsScene with lots of static items
    By lari in forum Qt Programming
    Replies: 12
    Last Post: 21st April 2010, 11:21
  4. Replies: 6
    Last Post: 5th March 2009, 06:26
  5. Moving an item in QGraphicsScene
    By prosass in forum Newbie
    Replies: 4
    Last Post: 28th March 2007, 14:21

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.