What I am trying to do is implementing a plain text editor. I need to use a QAbstractScrollArea instead of a QScrollArea because I want it to scroll lines instead of pixels when receiving a wheel event. Moreover, I'd like to have in the viewport another widget which shows line numbers and, when receiving horizontal scroll events, scroll only the widget with the text but not the widget with the line numbers.
I have already that working, but every time I move the widgets I receive paint event the whole size of the viewport. I can't use a QScrollArea because I can't scroll horizontally only part of the widgets shown as I need.
How can I tell the QAbstractScrollArea or the viewport() to update() only the needed parts?
Bookmarks