Change child color on QFrame Hover
Unsolved
Qt for Python
-
I have a QFrame with QLebels inside created as follow
frame = QFrame() lay = QHBoxLayout(frame) lay.addWidget(QLabel("text"))
Now I want that every time I hover the QFrame, the QLabel becomes red.
Here what I tryed
frame.setStyleSheet(""" :hover{ color:red } """
It doesn't really work. Is there any other way ?
-
Hi,
You have to make a subclass of QFrame and overload the hoverEvent method to apply the stylesheet on the label.