summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-10-29 11:03:34 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-10-29 11:50:52 (GMT)
commit316bf04887aed61804e16d64857754b78cf2f713 (patch)
tree42adc2189672e8b0763bf8a8c57841885d91b8d2 /src/gui
parent0f1aeb863474d2894a896fb28ea8eae8d736a363 (diff)
downloadQt-316bf04887aed61804e16d64857754b78cf2f713.zip
Qt-316bf04887aed61804e16d64857754b78cf2f713.tar.gz
Qt-316bf04887aed61804e16d64857754b78cf2f713.tar.bz2
ItemViews: make the geometries update when header data changes
autotest included Task-number: QT-711 Reviewed-by: ogoffart
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp4
-rw-r--r--src/gui/itemviews/qabstractitemview.h1
-rw-r--r--src/gui/itemviews/qabstractitemview_p.h1
3 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index d91cedd..9247411 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -605,6 +605,8 @@ void QAbstractItemView::setModel(QAbstractItemModel *model)
this, SLOT(_q_modelDestroyed()));
disconnect(d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
this, SLOT(dataChanged(QModelIndex,QModelIndex)));
+ disconnect(d->model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
+ this, SLOT(_q_headerDataChanged()));
disconnect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(rowsInserted(QModelIndex,int,int)));
disconnect(d->model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
@@ -637,6 +639,8 @@ void QAbstractItemView::setModel(QAbstractItemModel *model)
this, SLOT(_q_modelDestroyed()));
connect(d->model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
this, SLOT(dataChanged(QModelIndex,QModelIndex)));
+ connect(d->model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
+ this, SLOT(_q_headerDataChanged()));
connect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(rowsInserted(QModelIndex,int,int)));
connect(d->model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
diff --git a/src/gui/itemviews/qabstractitemview.h b/src/gui/itemviews/qabstractitemview.h
index f438148..7a0509b 100644
--- a/src/gui/itemviews/qabstractitemview.h
+++ b/src/gui/itemviews/qabstractitemview.h
@@ -358,6 +358,7 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_rowsRemoved(const QModelIndex&, int, int))
Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed())
Q_PRIVATE_SLOT(d_func(), void _q_layoutChanged())
+ Q_PRIVATE_SLOT(d_func(), void _q_headerDataChanged())
friend class QTreeViewPrivate; // needed to compile with MSVC
friend class QAccessibleItemRow;
diff --git a/src/gui/itemviews/qabstractitemview_p.h b/src/gui/itemviews/qabstractitemview_p.h
index 66b7662..c691f61 100644
--- a/src/gui/itemviews/qabstractitemview_p.h
+++ b/src/gui/itemviews/qabstractitemview_p.h
@@ -117,6 +117,7 @@ public:
virtual void _q_columnsInserted(const QModelIndex &parent, int start, int end);
virtual void _q_modelDestroyed();
virtual void _q_layoutChanged();
+ void _q_headerDataChanged() { doDelayedItemsLayout(); }
void fetchMore();