If I understand the question correctly, you want to completely remove the selected color so that the element under the mouse cursor is highlighted only with a dotted border.
: , QItemDelegate ( QItemDelegate QComboBox). :
class SelectionKillerDelegate : public QItemDelegate
{
virtual void paint(QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index) const override
{
QStyleOptionViewItem myOption = option;
myOption.state &= (~QStyle::State_Selected);
QItemDelegate::paint (painter, myOption, index);
}
};
, , QStyle::State_Selected, QItemDelegate::paint, drawBackground, , , .
comboBox->setItemDelegate (new SelectionKillerDelegate), QItemDelegate. .
, QStyle::State_HasFocus, , , - .