Qt 6.11 is out! See what's new in the release
blog
How to repaint entire visibleRegion - not only a part - when QScrollBar's value is changed
-
Hi,
I have QScrollArea and big widget on it. In big widget's paintEvent I paint many things. I notice that, when I change QScrollArea's ScrollBar for example like this:
scrollArea->verticalScrollBar()->setValue(scrollArea->verticalScrollBar()->value()+1);I don't repaint entire widget's visibleRegion, but only a part. I see that in paintEvent() method:
event->region();I would like to change entire widget's visibleRegion always.
Of course I can do something like that:
scrollArea->verticalScrollBar()->setValue(scrollArea->verticalScrollBar()->value()+1); repaint();but maybe there is a better idea?
I tried in paintEvent() method something like that:
if(event->region() != visibleRegion()) { event->ignore(); repaint(visibleRegion()); return; }But I get warning on debuq:
QWidget::repaint: Recursive repaint detected