paintEvent and overlay-graphics
hi,
i'm trying to render an immoveable overlay graphics in the paintEvent(...) function of a QScrollArea.
unfortunately, only the requested region gets actually updated, so my overlay element mostly doest'n get redrawn and is moved with the other graphics.
is there a way to bypass this? or is it absolutely necessary to put the overlay element in an extra widget?
Re: paintEvent and overlay-graphics
Quote:
void QAbstractScrollArea::paintEvent ( QPaintEvent * event ) [virtual protected]
This event handler can be reimplemented in a subclass to receive paint events (passed in event), for the viewport() widget.
Note: If you open a painter, make sure to open it on the viewport().
Reimplemented from QWidget.
Did you do it like this?
Re: paintEvent and overlay-graphics
yes. as far as i understand, even when i draw outside the requested area, painting is clipped to it.
so when i scroll by 1 line, only this line will be updated and the rest will simply be scrolled.
Re: paintEvent and overlay-graphics
Why dont u try painting in the parent class ??
The scroll area must have some owner, and painting on that may give effect of overlay...
hope i am making sense :D