2

When i put a widget on a form in Qt Designer and change its style, i can omit {} parenthesis.

enter image description here

Is there a way to change a style for hover state without {}?

QWidget {
    background-color: rgba(32, 255, 8, 95);
    margin-bottom: 3px;
}
QWidget:hover{
    background-color: rgba(32, 8, 255, 95);
}

This works, but i don't like duplication, and that all child widgets of the same class will inherit the style.

4

0 回答 0