Reputation: 43
I'm new on Qt and I'm looking for some way to modify the form of a QPushButton, but I didn't find something on the web. Is it possible and if so, how can I do this? Thx
Upvotes: 0
Views: 298
Reputation: 2315
If you want to change how the QPushButton looks, you can use the Qt style sheets. If you want to put an image on the button, you can take advantage of the "background-image" property of the QPushButton
QPushButton
{
background-image: url("alpha.jpg");
}
You can change other properties like "border", "background-color", etc. Your question needs to be more specific as to what visual elements you need. Go through the documentation, it will help you.
One way to go about getting a different for the QPushButton is to make the necessary image available. Get the necessary image and make sure it has a transparent background. Use could use other attributes of QPushButton like, "background-color: transparent" and without any border - "border: none".
Hope it helps!
Upvotes: 3