summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-07-09 09:28:26 (GMT)
committerQt Commercial Integration <QtCommercial@digia.com>2012-01-31 10:25:02 (GMT)
commit8b6cbe211675828ad2a53d109e85af2503ffe93c (patch)
tree4ca0aea2a4d0dbb16f00e31569b4a32c03caf109
parent08959ba828c8e60ff8a51ac73168efb6b3043b10 (diff)
downloadQt-8b6cbe211675828ad2a53d109e85af2503ffe93c.zip
Qt-8b6cbe211675828ad2a53d109e85af2503ffe93c.tar.gz
Qt-8b6cbe211675828ad2a53d109e85af2503ffe93c.tar.bz2
Small fix in iteviews for sizeHintForColumn/Row
We were trying to check the column/row count but always from the root of the model insteal of the root that can be defined in the view. Task-number: QTBUG-5773
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 8729906..5d858b6 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -2955,7 +2955,7 @@ int QAbstractItemView::sizeHintForRow(int row) const
{
Q_D(const QAbstractItemView);
- if (row < 0 || row >= d->model->rowCount() || !model())
+ if (row < 0 || row >= d->model->rowCount(d->root))
return -1;
ensurePolished();
@@ -2967,7 +2967,7 @@ int QAbstractItemView::sizeHintForRow(int row) const
for (int c = 0; c < colCount; ++c) {
index = d->model->index(row, c, d->root);
if (QWidget *editor = d->editorForIndex(index).editor)
- height = qMax(height, editor->size().height());
+ height = qMax(height, editor->height());
int hint = d->delegateForIndex(index)->sizeHint(option, index).height();
height = qMax(height, hint);
}
@@ -2986,7 +2986,7 @@ int QAbstractItemView::sizeHintForColumn(int column) const
{
Q_D(const QAbstractItemView);
- if (column < 0 || column >= d->model->columnCount() || !model())
+ if (column < 0 || column >= d->model->columnCount(d->root))
return -1;
ensurePolished();