-1

I need to change the drop-down button background of the QComboBox when the mouse hover on QComboBox.

I dont get how to do that?

If I wrote

QComboBox::drop-down:hover

it would be wrong because it is selector to hower ower drop-down button not ower QComboBox.

UPD: I mean about this button:

enter image description here

::drop-down - The drop-down button of a QComboBox.

ANSWER:

The desired behavior couldnt be reached via QSS. It needs to be implemented manually using events.

AeroSun
  • 2,401
  • 2
  • 23
  • 46

1 Answers1

1

Refer to QComboBox Styling

If I'm not misteken you should impelement your own method void QComboBox::mouseMoveEvent(QMouseEvent *event) when the mouse hovers the combobox we change its stylesheet QComboBox::StyleSheet

QComboBox{
 ...
 backround:red;
 ...
}

and after, when the mouse gets out of our combobox ,we reset the stylesheet to default.

QComboBox{
}
Redanium
  • 879
  • 5
  • 18