bibi
bibi

Reputation: 3765

QComboBox: change one option of stylesheet

I have some particular QComboBox like this (osx style):

enter image description here

that I want to highlight programmatically. I used

combo->setStyleSheet("background-color: yellow");

and the background get changed, but then the whole style of my widget becomes ugly like this:

enter image description here

as you can see, the background is ok, but dropdown button got changed with '90 motif style (old good days...)

Is it possible to just change the background?

Upvotes: 0

Views: 648

Answers (1)

Thomas McGuire
Thomas McGuire

Reputation: 5466

Some of the stylesheet rules will trigger a fallback to the Windows style, see my answer here.

One option to style the background is by using QProxyStyle.

Changing the palette might also work.

Upvotes: 1

Related Questions