diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-07-10 14:02:24 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-07-10 14:02:24 (GMT) |
commit | 7cca54d2bd7e8e42419210c499e27a1452447330 (patch) | |
tree | 0cff1542505df353ffffaf9b165f908feb099a1f /src/gui | |
parent | 788b8ab3eed9314310408a577d797471d392d582 (diff) | |
download | Qt-7cca54d2bd7e8e42419210c499e27a1452447330.zip Qt-7cca54d2bd7e8e42419210c499e27a1452447330.tar.gz Qt-7cca54d2bd7e8e42419210c499e27a1452447330.tar.bz2 |
QTableView: auto-scrolling could be broken by invisible sections
Task-number: 248688
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/itemviews/qtableview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp index 882a213..2009499 100644 --- a/src/gui/itemviews/qtableview.cpp +++ b/src/gui/itemviews/qtableview.cpp @@ -2040,7 +2040,7 @@ void QTableView::scrollTo(const QModelIndex &index, ScrollHint hint) if (positionAtRight || hint == PositionAtCenter || positionAtLeft) { int hiddenSections = 0; if (d->horizontalHeader->sectionsHidden()) { - for (int s = horizontalIndex; s >= 0; --s) { + for (int s = horizontalIndex - 1; s >= 0; --s) { int column = d->horizontalHeader->logicalIndex(s); if (d->horizontalHeader->isSectionHidden(column)) ++hiddenSections; @@ -2095,7 +2095,7 @@ void QTableView::scrollTo(const QModelIndex &index, ScrollHint hint) if (hint == PositionAtBottom || hint == PositionAtCenter || hint == PositionAtTop) { int hiddenSections = 0; if (d->verticalHeader->sectionsHidden()) { - for (int s = verticalIndex; s >= 0; --s) { + for (int s = verticalIndex - 1; s >= 0; --s) { int row = d->verticalHeader->logicalIndex(s); if (d->verticalHeader->isSectionHidden(row)) ++hiddenSections; |