summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2020-11-22 04:07:32 +0100
committerArno <arno@disconnect.de>2020-11-22 04:07:32 +0100
commit308f8ae11f08b811318373183e12b53d27deb631 (patch)
tree71278644a45a8cef846d10acd52a0f17b84ef0ba
parent9b0fb916acb6024988018ec5d13f52490f46d272 (diff)
downloadSheMov-308f8ae11f08b811318373183e12b53d27deb631.tar.gz
SheMov-308f8ae11f08b811318373183e12b53d27deb631.tar.bz2
SheMov-308f8ae11f08b811318373183e12b53d27deb631.zip
Select and expand in SearchDialog
When searching for actors, select the first item in the list and expand everything. For some strange reason QTreeView::expand or QTreeView::setExpanded does not work, so I grab the big hammer and expand all.
-rw-r--r--searchdialog.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/searchdialog.cpp b/searchdialog.cpp
index 086be9f..5c155b9 100644
--- a/searchdialog.cpp
+++ b/searchdialog.cpp
@@ -265,8 +265,14 @@ void ActorsAndMore::searchActor(const QString &actor){
getGenresForActor(cur);
root->appendRow(cur);
}
+
mResultView->setSortingEnabled(true);
mResultView->sortByColumn(0, Qt::AscendingOrder);
+ QModelIndex first = mResultModel->index(0,0);
+ if(first.isValid()){
+ mResultView->selectionModel()->setCurrentIndex(first, QItemSelectionModel::ClearAndSelect);
+ mResultView->expandAll();
+ }
}
void ActorsAndMore::searchSubtitle(const QString &subtitle){