Is it possible to set selected item style (Qt style sheet) of the QComboBox drop-down list?
@Sergey Vlasov: I don't know if there is a better solution to your problem but , but I managed to solve it with the following:
class MyDelegate : public QStyledItemDelegate
{
protected:
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
{
if (option.state & QStyle::State_HasFocus){
QStyleOptionViewItem my_option = option;
my_option.state = my_option.state ^ QStyle::State_HasFocus;
QStyledItemDelegate::paint(painter, my_option, index);
return;
}
QStyledItemDelegate::paint(painter, option, index);
}
};
And then using your delegate in your combobox:
QStyledItemDelegate* itemDelegate = new MyDelegate();
combobox->setItemDelegate(itemDelegate);
this eliminates nasty frame around selected item