PyQt5 – How to make semi-transparent label ?
While designing a GUI (Graphical User Interface) application we tend to make lot of labels, but sometimes some labels overlaps each other and only label which is on top is visible, that’s why semi transparent label is needed.
Normal label vs Semi-transparent label –
In order to create semi-transparent labels
setStyleSheet() method is used.
Syntax : label.setStyleSheet(“background-color: rgba(255, 255, 255, 10);”)
Here we are setting color using
RGBAi.e transparency factor, 255 is completely opaque, and an alpha of 0 is completely transparent.
Argument: It takes string as argument.
Action performed : It makes the color of the label transparent.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course