Simplify list views: prefer currentIndex over selection
A QListView (and more generally a QAbstractItemView) can be configured with either of
setSelectionMode(QAbstractItemView::SingleSelection);
setSelectionMode(QAbstractItemView::ExtendedSelection);
Currently, instrument, sample and material views are configured for single selection.
-
Consider single selection instead of extended selection also for mask, job, and fit parameter lists.
Currently several view classes are using QItemSelectionModel through calls like selectionModel()->select(idx, QItemSelectionModel::ClearAndSelect)
. This makes sense only with extended selection mode.
-
For all single selection mode classes, replace QItemSelectionModel calls by direct manipulation of currentIndex
.