Results 1 to 2 of 2

Thread: Limiting repaint events somehow

  1. #1
    Join Date
    Feb 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Limiting repaint events somehow

    I have an app.
    Multiple tabs.. quite a large number of widgets on each. labels/buttons ect.
    Most of these labels is getting updated information multiple times per second.

    On ons of these tabs I have a potentially opengl qGraphicsView scene.
    Which is quite intensive on the cpu/hardware.

    What I found out is that if any single widget redraws it seems the whole gui redraws itself.
    This includes widgets on other tabs.

    The result is a rather ineffecient application that basicly makes the cpu die.
    This is mostly problematic with the opengl widget when its in non-gl/software mode.

    I could find no way to force it down to a fix frame rate.

    I tried everything I can find or think of all ready.


    setViewportUpdateMode(QGraphicsView::NoViewportUpd ate); - no effect


    I played with: setUpdatesEnabled(false);
    but mostly the result is times when the widget is not drawn.


    If I click on a button next to the widget then somehow the paint event transfers over to all other widgets.
    Its as if when a widget redraws is forces its parent to redraw which then in turn forces all its children to redraw and this then runs recursively through the complete application

    Please is there anyway to make Qt behave itself?

    I should perhaps mention that:
    1. I don't use fixed sized widgets - I use Qts layouts to position things mostly.
    2. I have a rather large style sheet loaded over everything.

    What really freaks me is that stupid Qt will redraw the non-visible tabs.. this is fail.

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Limiting repaint events somehow

    I guess there's problem with your code that causes recursive redraw.

    Qt schedules paint events so if you call update() three times in a row then you'll get single paint event anyway.

    If this actually is qt problem, write small, compilable example of it and post it here, more likely you'll get an answer how to handle the issue.

Similar Threads

  1. Pop up menus disappear on repaint events
    By GimpMaster in forum Qt Programming
    Replies: 2
    Last Post: 27th December 2010, 17:23
  2. Replies: 4
    Last Post: 17th October 2010, 22:30
  3. Replies: 3
    Last Post: 16th September 2009, 05:10
  4. Limiting the number of instances of one application
    By fullmetalcoder in forum Qt Programming
    Replies: 29
    Last Post: 16th May 2009, 14:53
  5. Limiting values for custom designer properties
    By high_flyer in forum Qt Programming
    Replies: 4
    Last Post: 16th March 2006, 12:27

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.