QComboBox: Only show the icons when expanded
问题 Starting from a "normal" QCombobox I'd like to get a QCombobox that only shows the icon when it's expanded, but not when it's collapsed. I've found several answers to similar questions, but all of them show code for much more complex situations and I have not managed to distill the core of it. There are two approaches I've seen: attaching a QListView or using a QItemDelegate (or both). But I could not find any sample code that is straight to the point. This is my starting point: MainWindow: