I have a dialog with a set of radio buttons and a QListView.
The ui behavior that I'm trying to get is:
1. If user selects/activates an item in the QListViewthe the radio buttons should be unchecked.
2. If user checks a radio button, the selection should be cleared in the QListView.
I have gotten the behaviour I want by sub-classing QListView and implementing void selectionChanged ( const QItemSelection & selected, const QItemSelection & deselecte). This allows me to uncheck the radio buttons when an item is selected. When a radio button is checked by the user, I use QListView::clearSelection() to clear the selection. It works great.
However there is a visual issue. When the user selects an item either with the mouse or using tab and keystrokes, the background of the row containing the item is inverted. QListView::clearSelection() removes the selection but leaves the background of the row inverted. This might be confusing to the user. How to a restore the background of the item row so that it is not inverted.
Bookmarks