[Interest] Unnecessary repaints.

André Somers andre at familiesomers.nl
Thu Dec 17 13:03:48 CET 2015


Op 17/12/2015 om 12:55 schreef Bill Crocker:
> Hello:
>
> My very first Qt app is large and a little sloppy in
> that the QWidget::update() function is being called
> *someplace* where it should not, This is causing
> unnecessary repaints.
>
> Is there one place I can put a break to find the calls
> which actually cause a repaint (and not the calls
> which are made when a repaint is already pending).
>
> Or, can you recommend a better way to diagnose
> this problem. (The whole thing needs to be rewritten
> now that I am older and wiser, but not just yet.)
>
I'd try to log calls to update() on the widget, and dump the stacktrack 
for each of those to a file. You can do that (at least on gdb) by 
setting a breakpoint on it with some commands to run on the breakpoint, 
after wich you immediately resume. If you really break, it will be much 
harder to trace as returning to the running application afterwards will 
itself cause a repaint. Run your app for a bit, and inspect the file to 
see how your update got called.

André



More information about the Interest mailing list