how to create an image button
-
wrote on 21 Apr 2016, 14:03 last edited by
hi,
how i can create an image button in qt?
tnx -
wrote on 21 Apr 2016, 14:10 last edited by
Are you looking to have an image as the background on a button? If so, try:
button->setStyleSheet("border-image:url(:/Icons/images/myImage.png);");
Alternatively, you can use stylesheets. Take a look at the documentation here. Hope this helps!
-
wrote on 21 Apr 2016, 17:00 last edited by
tnx
but i does this but in stylesheet menu,in add resource menu
my images dose not known and identify and just write root!
what i must do?
tnx so much -
tnx
but i does this but in stylesheet menu,in add resource menu
my images dose not known and identify and just write root!
what i must do?
tnx so much@M4RZB4Ni
If you create a QResource file and added to project and and added
the image to this Qres and its not showing then
try to run qmake from the menu. -
@M4RZB4Ni
If you create a QResource file and added to project and and added
the image to this Qres and its not showing then
try to run qmake from the menu. -
@M4RZB4Ni
hi
Not sure which part. :)
This is how u get the qres file
http://www.bogotobogo.com/Qt/Qt5_Resource_Files.phpDo down to "Finish. "
Then right click qres and Select Add existing file
then point to ur image.Then up from Build menu, select qmake & build all
then try to browse again and u should see ur image.
-
@M4RZB4Ni
hi
Not sure which part. :)
This is how u get the qres file
http://www.bogotobogo.com/Qt/Qt5_Resource_Files.phpDo down to "Finish. "
Then right click qres and Select Add existing file
then point to ur image.Then up from Build menu, select qmake & build all
then try to browse again and u should see ur image.
5/7