Results 1 to 6 of 6

Thread: CPU churning with .update() (also scrolling with NoViewPortUpdate)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2008
    Posts
    14
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3

    Default CPU churning with .update() (also scrolling with NoViewPortUpdate)

    Hi,

    I load several thousand QGraphicsItems into a QGraphicsView and am having a serious problem with the update system. Once loaded, my cpu will churn away between 60-100%. I've figured out that this is mostly from bounding rect calls, and am not sure how to get rid of them.

    Is this a common problem? I haven't seen any other threads about a rampaging CPU when the program is idle, and am not certain where to look in my code for this.

    FYI I have indexing turned off if this is maybe related.

    On a very closely related note, If I turn off viewport updates:

    self.setViewportUpdateMode(QtGui.QGraphicsView.NoV iewportUpdate)

    this gets rid of the churning, and I use QGI.repaint() to render my hover highlighting, but there are two new problems (so far).

    1 my hover highlight is rendered as semi-transparent, other painter stuff is rendered semi-transparent as well.

    Any advice on this? I have no clue as to why the transparency changes with the internal update system off.

    2 I lose scrolling. I can repair the scrolling by overriding scrollContentsBy and including a viewport().update() call, but my scrolling becomes way jumpy compared to when viewport updates are turned on.

    Any advice on how the update system makes QGV scrolling so smooth?

    Thanks,

    Deacon
    Last edited by Deacon; 30th December 2008 at 00:31.

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.