summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-12-11 16:10:18 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-12-11 16:11:10 (GMT)
commit4e9063d7a8fc79d1cfee71d2c889877264d44086 (patch)
tree5d0169efcf6b09f6385c05ec3c7774cf1ad1ad39 /src/gui
parent6a1cff7c47e1f47161f765ba2f7094b55aaa13c5 (diff)
downloadQt-4e9063d7a8fc79d1cfee71d2c889877264d44086.zip
Qt-4e9063d7a8fc79d1cfee71d2c889877264d44086.tar.gz
Qt-4e9063d7a8fc79d1cfee71d2c889877264d44086.tar.bz2
Itemviews: we needed to call ensurePolishedwhen asking for sizehints
Reviewed-by: Pierre Rossi
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp4
-rw-r--r--src/gui/itemviews/qtreeview.cpp1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index de6e6cb..4a450b7 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -2867,6 +2867,8 @@ int QAbstractItemView::sizeHintForRow(int row) const
if (row < 0 || row >= d->model->rowCount() || !model())
return -1;
+ ensurePolished();
+
QStyleOptionViewItemV4 option = d->viewOptionsV4();
int height = 0;
int colCount = d->model->columnCount(d->root);
@@ -2896,6 +2898,8 @@ int QAbstractItemView::sizeHintForColumn(int column) const
if (column < 0 || column >= d->model->columnCount() || !model())
return -1;
+ ensurePolished();
+
QStyleOptionViewItemV4 option = d->viewOptionsV4();
int width = 0;
int rows = d->model->rowCount(d->root);
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index 3ad9fbb..bcf9cfb 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -2774,6 +2774,7 @@ int QTreeView::sizeHintForColumn(int column) const
d->executePostedLayout();
if (d->viewItems.isEmpty())
return -1;
+ ensurePolished();
int w = 0;
QStyleOptionViewItemV4 option = d->viewOptionsV4();
const QVector<QTreeViewItem> viewItems = d->viewItems;