summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-04-28 12:12:59 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-04-28 12:12:59 (GMT)
commit8bde410a6d0b1510d182a365d769db182b1c07dd (patch)
tree8bd7f8b375d23c5a7f723b86c7a1f5980babd111 /src/gui/itemviews
parenta8065da96b96fcc4baeca7615c2a4195c05cbc03 (diff)
downloadQt-8bde410a6d0b1510d182a365d769db182b1c07dd.zip
Qt-8bde410a6d0b1510d182a365d769db182b1c07dd.tar.gz
Qt-8bde410a6d0b1510d182a365d769db182b1c07dd.tar.bz2
Fixed the sizehint for cols/rows in qtableview
It could return wrong values because we were not always checking the right cols/rows. Reviewed-By: gabi Task-Number: QTBUG-10169
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r--src/gui/itemviews/qtableview.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index 80334a6..4492e53 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -2145,8 +2145,8 @@ int QTableView::sizeHintForRow(int row) const
ensurePolished();
- int left = qMax(0, columnAt(0));
- int right = columnAt(d->viewport->width());
+ int left = qMax(0, d->horizontalHeader->visualIndexAt(0));
+ int right = d->horizontalHeader->visualIndexAt(d->viewport->width());
if (right == -1) // the table don't have enough columns to fill the viewport
right = d->model->columnCount(d->root) - 1;
@@ -2204,8 +2204,8 @@ int QTableView::sizeHintForColumn(int column) const
ensurePolished();
- int top = qMax(0, rowAt(0));
- int bottom = rowAt(d->viewport->height());
+ int top = qMax(0, d->verticalHeader->visualIndexAt(0));
+ int bottom = d->verticalHeader->visualIndexAt(d->viewport->height());
if (!isVisible() || bottom == -1) // the table don't have enough rows to fill the viewport
bottom = d->model->rowCount(d->root) - 1;