summaryrefslogtreecommitdiffstats
path: root/qt-ui/divelistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r--qt-ui/divelistview.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp
index 28ed09f2c..d8e66d0c6 100644
--- a/qt-ui/divelistview.cpp
+++ b/qt-ui/divelistview.cpp
@@ -218,6 +218,8 @@ void DiveListView::selectDive(int i, bool scrollto, bool toggle)
if (idx.parent().isValid()) {
setAnimated(false);
expand(idx.parent());
+ if (scrollto)
+ scrollTo(idx.parent());
setAnimated(true);
}
if (scrollto)
@@ -274,6 +276,8 @@ void DiveListView::selectDives(const QList<int> &newDiveSelection)
this, SLOT(currentChanged(QModelIndex, QModelIndex)));
Q_EMIT currentDiveChanged(selected_dive);
const QModelIndex &idx = m->match(m->index(0, 0), DiveTripModel::DIVE_IDX, selected_dive, 2, Qt::MatchRecursive).first();
+ if (idx.parent().isValid())
+ scrollTo(idx.parent());
scrollTo(idx);
}
@@ -371,6 +375,7 @@ void DiveListView::reload(DiveTripModel::Layout layout, bool forceSort)
if (!isExpanded(curr)) {
setAnimated(false);
expand(curr);
+ scrollTo(curr);
setAnimated(true);
}
}