diff options
-rw-r--r-- | qt-ui/mainwindow.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index aac829ef1..93ea3d615 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -325,6 +325,12 @@ void MainWindow::readSettings() ui->ListWidget->resizeColumnToContents(i); } ui->ListWidget->collapseAll(); + ui->ListWidget->expand(sortModel->index(0,0)); + QModelIndex firstDiveOrTrip = sortModel->index(0,0); + if (sortModel->index(0,0, firstDiveOrTrip).isValid()) + ui->ListWidget->setCurrentIndex(sortModel->index(0,0, firstDiveOrTrip)); + else + ui->ListWidget->setCurrentIndex(firstDiveOrTrip); settings.endGroup(); } |