I want my button to have a blue background, then a green background when you hover the mouse over it.
This is my code:
self.button.setStyleSheet("background-color:blue")
self.button.setStyleSheet("QPushButton::hover"
"{"
"background-color:green;"
"}")
How can I make these two lines work at the same time?
Just join the qt stylesheets:
self.button.setStyleSheet(
"""
QPushButton{
background-color:blue;
}
QPushButton::hover{
background-color:green;
}
"""
)