Hi!

I'm developing a personal project in which I use a QAbstractScrollArea. Its viewport is the parent of another widget (subclass of QWidget) in which the drawing is made. While I was analysing the drawing performance on the viewport, I realized that, whenever I scroll the widget (using move()), the widget gets a paintEvent whose boundingRect is the size of the whole viewport.

The problem with this behaviour is that it forces the widget to redraw the entire visible area every time it is scrolled. If I use a QScrollArea instead (which I can't use because I need a finer-grained control over the viewport), when you scroll the widget moving the bars then the paintEvent which the widget receives has a region() the exact size of the scrolled area, and then the repainting is optimal.

I don't understand what I'm doing wrong, if anyone could help...

Thank you!