Okay so for erasing I did the following, may be this will be useful to someone.
painter.
setCompositionMode(QPainter::CompositionMode_Source);
painter.
setPen(QPen(QBrush(Qt
::transparent), myPenWidth, Qt
::SolidLine, Qt
::RoundCap, Qt
::RoundJoin));
QPainter painter(&m_mask);
painter.setCompositionMode(QPainter::CompositionMode_Source);
painter.setPen(QPen(QBrush(Qt::transparent), myPenWidth, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
To copy to clipboard, switch view to plain text mode
To understand the Composition Modes : http://doc.qt.io/qt-5/qpainter.html#...itionMode-enum
Thanks.
P.S.: Still working on the scrollarea stuff. Once done will update here.
Bookmarks