I have a QListWidget containing items which have icons and when the items are selected the icon is just highlighted out. Is there a way to prevent this? I can’t use stylesheets because it’s for an embedded application and including them takes up too much space.
thanks
I have a QListWidget containing items which have icons and when the items are
Share
Certainly, drawing on a black-and-white screen presents its challenges.
It sounds like you just want to change the appearance of the interface, not any functionality. If this is the case, a
QItemDelegate-derived class (orQStyledItemDelegate) is almost certainly what you want. In particular, thedrawDecorationfunction looks like it is used to draw an icon, and the style options should include whether it is selected. The simplest fix would be to override that function, set the selected flag in the options to false, then pass it up to the parent’s function.