From 8b6cbe211675828ad2a53d109e85af2503ffe93c Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Fri, 9 Jul 2010 11:28:26 +0200 Subject: 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 --- src/gui/itemviews/qabstractitemview.cpp | 6 +++--- 1 file 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(); -- cgit v0.12