combobox - QtGui.QComboBox and setStyleSheet- I need that only the selected value will jave a different BG color -


i'm using setstylesheetin order set colors qtgui.qcombobox. need specific selected value cause area of selected field have red bg color, but, list should remain white bg color. able create 2 different cases , both have problems, please advice.

first case+problem: managed change selected value bg color red, but, @ moment user clicks in someplace else on ui, bg color white again:

self.combobox.setstylesheet("selection-background-color:red;") #at moment user clicks somewhere else, bg white again. ,     problematic me. 

second case+problem:

self.combobox.setstylesheet("background-color:red;")')  #this option causes whole list become red, remains red needed , not turn bg=white if click in someplace else in ui. 

thank in advanced help.

i think should try qss objects roles -- ie,

qss

combobox::item:selected { background-color: red; }


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -