summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-11-08 15:09:00 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-20 14:13:07 +0100
commitbf909bd637e4910a75b60df3b3ca5f2dd79515e4 (patch)
tree1921439ba4d555cbb0944bc8ae9708eb383d6477 /src/widgets
parente4179d103371ce179a27470ebd99e673bd5783b8 (diff)
QHeaderView - do not keep indexes from an obsolete model
When we call setModel persistentHiddenSections are no longer relevant. It contains indexes from the previous model. This solves: Task-number: QTBUG-18196 Change-Id: Ida02fa63a915695e3730fd63995ac5f8520ae827 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/itemviews/qheaderview.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 21c2e9050c..feda750729 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -350,6 +350,7 @@ void QHeaderView::setModel(QAbstractItemModel *model)
if (model == this->model())
return;
Q_D(QHeaderView);
+ d->persistentHiddenSections.clear();
if (d->model && d->model != QAbstractItemModelPrivate::staticEmptyModel()) {
if (d->orientation == Qt::Horizontal) {
QObject::disconnect(d->model, SIGNAL(columnsInserted(QModelIndex,int,int)),