summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-07-10 13:30:01 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-07-10 13:30:56 (GMT)
commite2bf5eeee12329ad4aee941b5bb70af4ee5bb32f (patch)
tree829cdee2e9f94e28cbfc5c8f49b7c0b350b5ff8f /src
parentbc747a81f4f6f0978f71cd8d19f69060fc8a8041 (diff)
downloadQt-e2bf5eeee12329ad4aee941b5bb70af4ee5bb32f.zip
Qt-e2bf5eeee12329ad4aee941b5bb70af4ee5bb32f.tar.gz
Qt-e2bf5eeee12329ad4aee941b5bb70af4ee5bb32f.tar.bz2
QTableView: horizontal scrollbar could be inoperent with big columns
Task-number: 240266
Diffstat (limited to 'src')
-rw-r--r--src/gui/itemviews/qtableview.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index c676237..882a213 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -1528,6 +1528,8 @@ void QTableView::updateGeometries()
++columnsInViewport;
}
}
+ columnsInViewport = qMax(columnsInViewport, 1); //there must be always at least 1 column
+
if (horizontalScrollMode() == QAbstractItemView::ScrollPerItem) {
const int visibleColumns = columnCount - d->horizontalHeader->hiddenSectionCount();
horizontalScrollBar()->setRange(0, visibleColumns - columnsInViewport);
@@ -1554,6 +1556,8 @@ void QTableView::updateGeometries()
++rowsInViewport;
}
}
+ rowsInViewport = qMax(rowsInViewport, 1); //there must be always at least 1 row
+
if (verticalScrollMode() == QAbstractItemView::ScrollPerItem) {
const int visibleRows = rowCount - d->verticalHeader->hiddenSectionCount();
verticalScrollBar()->setRange(0, visibleRows - rowsInViewport);