Not winning

Created in header class of myLabel (as QPainter is within this class)
Qt Code:
  1. void resizeEvent(QResizeEvent *event);
To copy to clipboard, switch view to plain text mode 
implementation.cpp:
Qt Code:
  1. void resizeEvent(QResizeEvent *event)
  2. {
  3. //Taken partially from example Scribble ( http://www.trinitydesktop.org/docs/qt4/widgets-scribble.html )
  4.  
  5. if(width() > fplabel.width() || height() > fplabel.height())
  6. {
  7. int newWidth = qMax(width()+128, fplabel.width());
  8. int newHeight = qMax(height()+128, fplabel.height());
  9. QSize(newWidth, newHeight);
  10. QImage newImage(newSize);
  11. QPainter painter(&newImage);
  12. painter.drawImage(QPoint(0, 0), *image);
  13. *image = newImage;
  14. update();
  15. }
  16. }
To copy to clipboard, switch view to plain text mode 

Image is uploaded in main class

Not sure how to go about it

ideas please