setAlternatingRowColors(true);
setRootIsDecorated(settings->expandableFolders());
setItemsExpandable(settings->expandableFolders());
+ setEditTriggers(QAbstractItemView::NoEditTriggers);
setMouseTracking(true);
void DolphinDetailsView::currentChanged(const QModelIndex& current, const QModelIndex& previous)
{
QTreeView::currentChanged(current, previous);
- selectionModel()->select(current, QItemSelectionModel::ClearAndSelect);
+
+ // Stay consistent with QListView: When changing the current index by key presses,
+ // also change the selection.
+ if (QApplication::mouseButtons() == Qt::NoButton) {
+ selectionModel()->select(current, QItemSelectionModel::ClearAndSelect);
+ }
}
void DolphinDetailsView::setSortIndicatorSection(DolphinView::Sorting sorting)