I have renewed.Thanks for the quick reply!
What I don’t understand is why these my two methods are so different, why the CPU consumption is so different? Looks like they are doing the same partial refresh.
Maybe as you said:QWidget does not offer to "erase" something - all you can do is to redraw from scratch.
Hard to say what your code is doing as the code snippet does not show the real code.
But the plot canvas is actually using a backing store ( a QPixmap ), that gets updated on certain operations like when the size of the canvas is changing or replot has been called.
Beside that the content of the widget is always restored from this backing store only.
So when calling QWidget::update( region ) only all what happens is, that the rectangles from region will be copied from the backing store of the canvas to another backing store - the default one every widgets has.
Uwe
@lockdown Have you found a way to achieve this? because I am running in circles about the same issue and that would be really great help.
Bookmarks