summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/widget/wlibrarytableview.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/widget/wlibrarytableview.cpp b/src/widget/wlibrarytableview.cpp
index 2f9897c847..06740d3bf9 100644
--- a/src/widget/wlibrarytableview.cpp
+++ b/src/widget/wlibrarytableview.cpp
@@ -172,8 +172,12 @@ void WLibraryTableView::focusInEvent(QFocusEvent* event) {
selectRow(0);
DEBUG_ASSERT(currentIndex().row() == 0);
} else {
- // Select the focused row
- selectRow(currentIndex().row());
+ // Select the row of the currently focused index.
+ // For some reason selectRow(currentIndex().row()) would not
+ // select for the first Qt::BacktabFocusReason in a session
+ // even though currentIndex() is valid.
+ selectionModel()->select(currentIndex(),
+ QItemSelectionModel::Select | QItemSelectionModel::Rows);
}
}
DEBUG_ASSERT(currentIndex().isValid());