Setting QComboBox stylesheet reduces hight of dropdown [SOLVED]
I want my combobox to be blue. That is achieved by setting the stylesheet:
There is only one downside:
Setting the above styling reduces the amount of items displayed when the combobox is clicked on the subitem list is displayed.
What can I do to set the textcolor and have all subitems of the combobox displayed when I click on the combobox.
kind regards, reinhart
you can try this:
QAbstractItemView * view = combo->view();
QPalette p = view->palette();
Not tested though.
Thanks a lot - works nicely!
NicuPopescu last edited by
qss for combo should not affect the number of visible items
where/when do you apply the style sheet?
just in case you could control the number of max visible items, after the style sheet setting, with:
the combobox is part of a QTableWidget. I think setting the stylesheet overwrites some default stylings (at least that is my explaination I don't know if that's true).
Thanks for the hint with maxvisible item, though!