PDA

View Full Version : Limiting repaint events somehow



Marcaunon
13th February 2012, 15:26
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.

Spitfire
15th February 2012, 14:31
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.