summaryrefslogtreecommitdiffstats
path: root/torrentwidget.cpp
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2016-09-16 11:07:37 +0200
committerArno <arno@disconnect.de>2016-09-16 11:07:37 +0200
commit22d5bcbcb79dea84e7aab4e2032ae3638fbca581 (patch)
treee95026bb083e2b74d2ddbc62e211c3bc68241539 /torrentwidget.cpp
parentc1b9c52976acc1131f4e2315e24b11e1b3e15a5f (diff)
downloadShemovCleaner-22d5bcbcb79dea84e7aab4e2032ae3638fbca581.tar.gz
ShemovCleaner-22d5bcbcb79dea84e7aab4e2032ae3638fbca581.tar.bz2
ShemovCleaner-22d5bcbcb79dea84e7aab4e2032ae3638fbca581.zip
Always select and set current first row
Diffstat (limited to 'torrentwidget.cpp')
-rw-r--r--torrentwidget.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/torrentwidget.cpp b/torrentwidget.cpp
index f7b51df..bb392d0 100644
--- a/torrentwidget.cpp
+++ b/torrentwidget.cpp
@@ -326,6 +326,13 @@ void TorrentWidget::fileSelectionChanged(const QItemSelection &selected, const Q
emit selectionCountChanged(msg);
}
+void TorrentWidget::selectFirst(){
+ if(mModel->rowCount() > 0){
+ QModelIndex idx = mModel->index(0, 0);
+ mFileView->selectionModel()->select(idx, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows);
+ }
+}
+
void TorrentWidget::readSettings(){
QSettings s;
QString dir = s.value("searchdir", QDir::toNativeSeparators(QDir::homePath())).toString();