You photoRecovery button and createImage button should be created from a class that reimplements the QAbstractButton (or may be QPushButton). Let will be something like

Qt Code:
  1. class PictureButton : public QAbstractButton
  2. {
  3. public:
  4. //constructors and all other functions that you need.
  5. protected:
  6. void enterEvent(QEvent *event);
  7. void leaveEvent(QEvent *event);
  8. };
To copy to clipboard, switch view to plain text mode 

The implementation of enterEvent and leaveEvent is already given by vfernandez

Now, you will need to create the buttons in following way

Qt Code:
  1. PictureButton *photoRecoveryButton = new PictureButton(icon,parent);
  2. PictureButton *createImageButton = new PictureButton(icon,parent);
To copy to clipboard, switch view to plain text mode 

Hope this helps.