Stylesheet for qcombobox
-
How do I write stylesheet selector to change background of QComboBox's QLineEdit? I tried this:
a) QComboBox {background-color: rgb(255, 192, 192);} - it restyles the drop down button as well which doesn't look good at all,
b) QComboBox QLineEdit {background-color: rgb(255, 192, 192);} - doesn't change anything.Any other options?
-
Have a look "here":http://doc.qt.nokia.com/4.7/stylesheet-examples.html#customizing-qcombobox
-
Does the page say how to style QLineEdit inside QComboBox? If so, I cannot see it.
-
OK, you're right sorry about that, I thought the editable was for the lineedit (instead of just indicating whether it is present or not). I didn't find a way to access the QLineEdit directly from within the stylesheet, but you have two alternatives:
Set the background for the entire QComboBox and set it back for QComboBox::drop-down
Use the lineEdit() function to access the lineedit and set the stylesheet directly
Hope that helps and sorry I lead you the wrong way at first