Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
What's the best way to style a QPushButton? Setting background image or setting an icon?
stefanl last edited by stefanl
I'm trying to create a styled button with an svg file I have. I'd like it to have some sort of simple animation when the button is clicked (turning slightly darker or something). Is it better to set the svg as the background image in the button's stylesheet? Or is setting the svg as the button icon better? What are the differences? What's the best way to get the 'click' animation I'm going for? I'm using Qt Designer for this. Any help is much appreciated!
stefanl last edited by
Cool, thanks for your response! Do you know what the difference is between using background-image in a stylesheet and using set-icon?
The buttons are designed to handle icons like show in the documentation, a background image as the name suggests will be put in the image as background of the widget.