Okay so for erasing I did the following, may be this will be useful to someone.

Qt Code:
  1. QPainter painter(&m_mask);
  2. painter.setCompositionMode(QPainter::CompositionMode_Source);
  3. 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.