PyQt5 – How to add border on QLabel ?
When we create Label in PyQt5, we can see that there are no borders like there exist in Push Buttons, in this article we will see how to add border to the Label.
In order to add border to the Label we will use
label.setStyleSheet() method, this will add the border to the label, also we can set the thickness as well as color of the border.
Syntax : label.setStyleSheet(“border: 1px solid black;”)
Argument : It takes string as a argument.
Action performed : This will create a border on label with thickness of 1px and color will be black.
Below is the Python implementation –