Hi everybody,
I want to display an image (.png) over a QPushButton object in order to customize its look.
My png file has a size bigger than my button's so what I am trying to do is scaling down my image size to the button's size and then display the image over my button.
The problem is that my pixmap is never scalled to the button's size and I don't understand why, so if somebody could help me it would be great.
Here is my code :
img.resize(90, 24);
img.load("play.png");
img.scale(90, 24);
pix.convertFromImage(img);
but.setPixmap(pix);
QPushButton but;
QImage img;
img.resize(90, 24);
img.load("play.png");
img.scale(90, 24);
QPixmap pix;
pix.convertFromImage(img);
but.setPixmap(pix);
To copy to clipboard, switch view to plain text mode
Thanks in advance
Bookmarks