PyQt5 – How to change color of the label ?
While creating a Label in PyQt5, we can see that there is no background color. In this article we will see how to add background color to the Label.
In order to add border to the Label we will use
label.setStyleSheet() method, this will add the background color to the label, it is same like designing the CSS style sheet.
Syntax : label.setStyleSheet(“background-color: cyan”)
Argument : It takes string as argument.
Action performed: It changes the background color of the label.