Connect to the moved signals in the header view.
authorStephen Kelly <stephen.kelly@kdab.com>
Thu, 15 Dec 2011 14:35:59 +0000 (15:35 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 21 Dec 2011 16:39:36 +0000 (17:39 +0100)
Change-Id: I6954f77ad7d02970f562abcbaf4e733c6d43ead5
Reviewed-by: David Faure <faure@kde.org>
src/widgets/itemviews/qheaderview.cpp

index d4edbb7..cbc4036 100644 (file)
@@ -370,6 +370,8 @@ void QHeaderView::setModel(QAbstractItemModel *model)
                             this, SLOT(sectionsAboutToBeRemoved(QModelIndex,int,int)));
         QObject::disconnect(d->model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
                             this, SLOT(_q_sectionsRemoved(QModelIndex,int,int)));
+        QObject::disconnect(d->model, SIGNAL(columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
+                            this, SLOT(_q_layoutAboutToBeChanged()));
     } else {
         QObject::disconnect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)),
                             this, SLOT(sectionsInserted(QModelIndex,int,int)));
@@ -377,6 +379,8 @@ void QHeaderView::setModel(QAbstractItemModel *model)
                             this, SLOT(sectionsAboutToBeRemoved(QModelIndex,int,int)));
         QObject::disconnect(d->model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
                             this, SLOT(_q_sectionsRemoved(QModelIndex,int,int)));
+        QObject::disconnect(d->model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
+                            this, SLOT(_q_layoutAboutToBeChanged()));
     }
     QObject::disconnect(d->model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
                         this, SLOT(headerDataChanged(Qt::Orientation,int,int)));
@@ -392,6 +396,8 @@ void QHeaderView::setModel(QAbstractItemModel *model)
                              this, SLOT(sectionsAboutToBeRemoved(QModelIndex,int,int)));
             QObject::connect(model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
                              this, SLOT(_q_sectionsRemoved(QModelIndex,int,int)));
+            QObject::connect(model, SIGNAL(columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
+                             this, SLOT(_q_layoutAboutToBeChanged()));
         } else {
             QObject::connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
                              this, SLOT(sectionsInserted(QModelIndex,int,int)));
@@ -399,6 +405,8 @@ void QHeaderView::setModel(QAbstractItemModel *model)
                              this, SLOT(sectionsAboutToBeRemoved(QModelIndex,int,int)));
             QObject::connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
                              this, SLOT(_q_sectionsRemoved(QModelIndex,int,int)));
+            QObject::connect(model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
+                             this, SLOT(_q_layoutAboutToBeChanged()));
         }
         QObject::connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
                          this, SLOT(headerDataChanged(Qt::Orientation,int,int)));