changeset 82:9a03703622b8

Scroll to selection when invisible
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 18 Jun 2015 17:58:34 +0200
parents 5923d569167b
children 11aaa9214cfb
files src/metadataview.cpp
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/metadataview.cpp	Thu Jun 18 17:48:28 2015 +0200
+++ b/src/metadataview.cpp	Thu Jun 18 17:58:34 2015 +0200
@@ -149,6 +149,9 @@
     emit selectionChanged(idx.data().toString(), idx.row(), mSortModel->rowCount() - 1,
             timestamp, selected.indexes()[0].data().toInt());
     qDebug() << "Selection changed: " << idx.data();
+    if (!isVisible()) {
+        mView->scrollTo(selected.indexes()[0], QAbstractItemView::PositionAtTop);
+    }
 }
 
 void MetaDataView::selectFirstRow() {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)