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
{
public:
//constructors and all other functions that you need.
protected:
void enterEvent
(QEvent *event
);
void leaveEvent
(QEvent *event
);
};
class PictureButton : public QAbstractButton
{
public:
//constructors and all other functions that you need.
protected:
void enterEvent(QEvent *event);
void leaveEvent(QEvent *event);
};
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
PictureButton *photoRecoveryButton = new PictureButton(icon,parent);
PictureButton *createImageButton = new PictureButton(icon,parent);
PictureButton *photoRecoveryButton = new PictureButton(icon,parent);
PictureButton *createImageButton = new PictureButton(icon,parent);
To copy to clipboard, switch view to plain text mode
Hope this helps.
Bookmarks