Results 1 to 9 of 9

Thread: QWidget update get so cpu usage

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,324
    Thanks
    316
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QWidget update get so cpu usage

    The human eye cannot detect anything that changes faster than about 30 times per second, and even then can't process the changes in the brain unless the changes are gradual (like a movie). So it makes no sense at all to try to animate anything faster than 10 - 20 steps per second (i.e a timer with timeout of 100 - 50 ms). Otherwise you're just burning up CPU cycles for no good reason and slowing everything else down.

    If your animation steps can be pre-computed (that is, drawn into a series of images once instead of being drawn each step in real time), then store the images as resources in your application and simply display each image one after the other using QImage or QPixmap. This will probably be much faster than a bunch of QPainter operations with pens, brushes, and shapes.
    Last edited by d_stranz; 19th August 2012 at 00:27.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Using QWidget::update() from non-GUI thread
    By some_birdie in forum Qt Programming
    Replies: 3
    Last Post: 21st June 2011, 09:11
  2. QWidget::update does not work!
    By sapali in forum Qt Programming
    Replies: 8
    Last Post: 17th March 2011, 16:56
  3. Unable to update QTableWidget which is on Different QWidget from MainWindow
    By sagar.mangalwedhekar in forum Qt Programming
    Replies: 1
    Last Post: 12th March 2010, 07:07
  4. update() in QWidget
    By salmanmanekia in forum Qt Programming
    Replies: 5
    Last Post: 28th July 2008, 08:03
  5. QWidget::update() qeustion
    By tanki95 in forum Qt Programming
    Replies: 7
    Last Post: 14th March 2008, 02:29

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.