Hover stylesheet. PySide2
Moved
Unsolved
Qt for Python
-
self.pushButton_30.setStyleSheet(u""" background-color: black; color: white; border: 2px solid rgb(166, 166, 166); border-radius: 4px; """)
I have my stylesheet, but no matter the way I try and do hover it doesnt work-I've tried everything,
self.pushButton_30.setStyleSheet(u""" ButtonThirty{ background-color: black; color: white; border: 2px solid rgb(166, 166, 166); border-radius: 4px; } ButtonThirty:hover{ color: black; } """)
I've tried one colon, two colons, ive tried
*:hover
, can anyone help? Btw when I do the above it makes the entire button black (meaning it didnt parse it correctly, even when I put the color: white it still doesnt work. Anyone know?
Edit:self.pushButton_30 = QPushButton(self.widget) self.pushButton_30.setObjectName(u"pushButton_30") self.pushButton_30.setGeometry(QRect(300, 160, 111, 51)) self.pushButton_30.setStyleSheet(u""" background-color: black; color: white; border: 2px solid rgb(166, 166, 166); border-radius: 4px; """) self.pushButton_30.setAutoDefault(False)