diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2010-07-09 09:28:26 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2010-07-09 09:28:26 (GMT) |
commit | 2b358140c6b75ee29135175535190d415f5af10f (patch) | |
tree | 732c036df752504af32895d32b28757466c31dab /src/gui/itemviews | |
parent | 1e9a92cd6e8670a9dc90fed2044e7de38a3b13e6 (diff) | |
download | Qt-2b358140c6b75ee29135175535190d415f5af10f.zip Qt-2b358140c6b75ee29135175535190d415f5af10f.tar.gz Qt-2b358140c6b75ee29135175535190d415f5af10f.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
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 302aa20..ea24328 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -2944,7 +2944,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(); @@ -2956,7 +2956,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); } @@ -2975,7 +2975,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(); |