Reimplement QIdentityProxyModel::headerData().
authorSergio Martins <iamsergio@gmail.com>
Thu, 2 Feb 2012 17:00:13 +0000 (17:00 +0000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 3 Feb 2012 00:36:45 +0000 (01:36 +0100)
The one in the base class is slower due to parent<->source
mappings.

Change-Id: Ib0b337ef5d4b5b8cd9f6e1d7c5c19a770b53e0e8
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
src/corelib/itemmodels/qidentityproxymodel.cpp
src/corelib/itemmodels/qidentityproxymodel.h

index d43ee2e..1f95ac0 100644 (file)
@@ -319,6 +319,15 @@ int QIdentityProxyModel::rowCount(const QModelIndex& parent) const
 /*!
     \reimp
  */
+QVariant QIdentityProxyModel::headerData(int section, Qt::Orientation orientation, int role) const
+{
+    Q_D(const QIdentityProxyModel);
+    return d->model->headerData(section, orientation, role);
+}
+
+/*!
+    \reimp
+ */
 void QIdentityProxyModel::setSourceModel(QAbstractItemModel* sourceModel)
 {
     beginResetModel();
index 696986f..918ae24 100644 (file)
@@ -67,6 +67,7 @@ public:
     QModelIndex mapToSource(const QModelIndex& proxyIndex) const;
     QModelIndex parent(const QModelIndex& child) const;
     int rowCount(const QModelIndex& parent = QModelIndex()) const;
+    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
     bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent);
 
     QItemSelection mapSelectionFromSource(const QItemSelection& selection) const;