How to use IMAGE AS BUTTON?
-
wrote on 10 Jan 2018, 09:37 last edited by adityatrikha08 1 Oct 2018, 09:40
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.
-
wrote on 10 Jan 2018, 10:01 last edited by Pradeep Kumar 1 Oct 2018, 12:13
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,
wrote on 15 Jan 2018, 06:31 last edited by@Pradeep-Kumar Thanks Sir, Now its working,
I was giving absolute path. -
wrote on 15 Jan 2018, 09:53 last edited by Pradeep Kumar
4/4