Mercurial > retraceit
comparison src/metadataview.cpp @ 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 | 3916cb3c9105 |
comparison
equal
deleted
inserted
replaced
81:5923d569167b | 82:9a03703622b8 |
---|---|
147 } | 147 } |
148 } | 148 } |
149 emit selectionChanged(idx.data().toString(), idx.row(), mSortModel->rowCount() - 1, | 149 emit selectionChanged(idx.data().toString(), idx.row(), mSortModel->rowCount() - 1, |
150 timestamp, selected.indexes()[0].data().toInt()); | 150 timestamp, selected.indexes()[0].data().toInt()); |
151 qDebug() << "Selection changed: " << idx.data(); | 151 qDebug() << "Selection changed: " << idx.data(); |
152 if (!isVisible()) { | |
153 mView->scrollTo(selected.indexes()[0], QAbstractItemView::PositionAtTop); | |
154 } | |
152 } | 155 } |
153 | 156 |
154 void MetaDataView::selectFirstRow() { | 157 void MetaDataView::selectFirstRow() { |
155 qDebug() << "Selecting first row"; | 158 qDebug() << "Selecting first row"; |
156 selectRow(0); | 159 selectRow(0); |