How to use IMAGE AS BUTTON?
-
I want to insert an IMAGE, and use that particular IMAGE AS BUTTON.
Using only the code option and not use the DESIGN PART.
eg: The play and pause button which appear as inverted triangle and a square respectively , in a video file etc.
Could I get help with same.
-
Hi,
You can use QPushButton, and add the image we have setIcon() method
QPushbutton *button = new QPushbutton;
button->setIcon(QIcon("<imagePath>"));Add images in the resource file, as it will relative path, dont provide absolute path.
Based on the condition, change the image in Button, for play and pause.Thanks,
-
Hi,
You can use QPushButton, and add the image we have setIcon() method
QPushbutton *button = new QPushbutton;
button->setIcon(QIcon("<imagePath>"));Add images in the resource file, as it will relative path, dont provide absolute path.
Based on the condition, change the image in Button, for play and pause.Thanks,
@Pradeep-Kumar Thanks Sir, Now its working,
I was giving absolute path. -