OK, I'm sure I'm missing something here, but how do I set items in a QListWidget to have an icon that can be hidden? For instance, I want to have enough space for the items in the QListWidget to have a 16x16 icon. When the program starts, the icon will be hidden until the user selects an item in the list, the resulting form displayed (in an attached QScrollArea), and the form modified with user input. Once this happens, I want to emit a signal back to the main window which would then display the hidden "save file" icon.

This action is similar to how kate and kdevelop interact with edited files in the document view.

I've looked into trying to modify the QIcon directly, but there isn't a reference given back from QListWidget::icon(). I don't want to have to create an icon with all alpha blending (for transparency) with a size of 16x16 and flip-flop between icons. There has to be a way for me to sub-class QListWidgetItem or QListWidget for me to be able to dynamically show/hide the icon. All while not having the items in the list shift left to right when the icon is shown and hidden.

Anyone have any insight for me to be able to show/hide icons in a QListWidget while maintaining a 16x16 space between the left edge of the widget, and the start of the row's text?

Thanks!