One more feature, sorry to extend in the same question but it's because the context has already been set.

In order to implement scaling on the wheel event I did the following:

Qt Code:
  1. void
  2. LT_DrawingCanvas::wheelEvent(QWheelEvent *event)
  3. {
  4. QWidget::wheelEvent(event);
  5. scaleFactor += ((float)event->delta()/1200.0);
  6. update();
  7. }
To copy to clipboard, switch view to plain text mode 

and in the paintEvent:

Qt Code:
  1. void
  2. LT_DrawingCanvas::paintEvent(QPaintEvent *pe)
  3. {
  4. QPainter p(this);
  5. p.scale(scaleFactor, scaleFactor);
  6. p.drawPixmap(0, 0, m_base);
  7. p.drawImage(0, 0, m_mask);
  8. }
To copy to clipboard, switch view to plain text mode 


My widget hierarchy is as below:
Mainwindow
- Grid Layout
- Scrollarea
- MyCustomDrawing Canvas Widget (created just like the code wysota suggested above)

I am not getting the scrollbars on scaling the image. I realize I am drawing the scaled image again, instead of resizing the widget. I tried using resize on the widget but it didn't work. What I am doing wrong ?