You should give viewport to QPainter.
Qt Code:
To copy to clipboard, switch view to plain text mode
See Qt docs:
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().
Bookmarks