PyQt5 – Add image icon on a Push button
In this article we will see how to add icon to a push button. Here, setting icon not like setting an background image, it is similar to the icon of main window. Icon of button appear at the left side and text is on right size.
Below is the representation of pus button without and with icon.
In order to do this we will use
Syntax : button.setIcon(QIcon(‘logo.png’))
Argument : It takes file name if in same folder else file path
Action performed : It sets icon to the button.