summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-07-10 14:02:24 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-07-10 14:02:24 (GMT)
commit7cca54d2bd7e8e42419210c499e27a1452447330 (patch)
tree0cff1542505df353ffffaf9b165f908feb099a1f /src
parent788b8ab3eed9314310408a577d797471d392d582 (diff)
downloadQt-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')
-rw-r--r--src/gui/itemviews/qtableview.cpp4
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;