diff options
author | Arno <am@disconnect.de> | 2014-11-08 04:31:40 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2014-11-08 04:31:40 +0100 |
commit | bd3716dcab86c7d3e018004a1f26b470a7f6cfb7 (patch) | |
tree | da7514793f4fbe164812c5aa558460a3606b5128 /fileview.cpp | |
parent | c114cd223ef1d618c5d5b19b371fa1711c3c3779 (diff) | |
download | SheMov-bd3716dcab86c7d3e018004a1f26b470a7f6cfb7.tar.gz SheMov-bd3716dcab86c7d3e018004a1f26b470a7f6cfb7.tar.bz2 SheMov-bd3716dcab86c7d3e018004a1f26b470a7f6cfb7.zip |
Select child dir when going up in directory hierarchy
Select the previously selected dir in FileView when going up in the
directory hierarchy.
Diffstat (limited to 'fileview.cpp')
-rw-r--r-- | fileview.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fileview.cpp b/fileview.cpp index 7280696..72ebf7f 100644 --- a/fileview.cpp +++ b/fileview.cpp @@ -221,6 +221,15 @@ void FileView::properties(){ fpd.exec(); } +void FileView::selectItem(const QString &item){ + QModelIndex start = mProxy->index(0, 0); + QModelIndexList items = mProxy->match(start, Qt::DisplayRole, item, 1, Qt::MatchExactly | Qt::MatchWrap); + if(!items.isEmpty()){ + selectionModel()->select(items.at(0), QItemSelectionModel::Rows | QItemSelectionModel::Select); + scrollTo(items.at(0)); + } +} + void FileView::saveSelection(){ mSelectedFiles.clear(); QModelIndexList selected = selectionModel()->selectedRows(SmDirModel::Name); |