Reputation: 42593
Given a QComboBox widget, i can easily change style for drop-down list. Foe example, this style sheet adds green border for drop down list:
QComboBox QAbstractItemView { border: 5px solid green; }
But if i try to change style for individual items, it simply doesn't work:
QComboBox QAbstractItemView::item { border: 5px solid green; }
is it possible to change style for individual list items in QComboBox, or it's not supported?
Upvotes: 0
Views: 893
Reputation: 4196
Yup, you can do it. All what you need is to use QAbstractItemDelegate. To use it just call QComboBox::setItemDelegate()
Upvotes: 1