PyQt5 – Change the text font and size in Push button
In this article we will see how to change the text style or size of Push Button.
QPushButton is a simple button in PyQt, when clicked by a user some associated action gets performed. For adding this button into the application, QPushButton class is used.
In order to set font we will use setFont method which takes QFont object as argument.
Syntax : button.setFont(QFont(‘Arial’, 15))
Argument : It takes two argument first is font name and other is integer which refer to size of text.
Action performed It changes the size and font of text.