Reimplement QIdentityProxyModel::headerData().

The one in the base class is slower due to parent<->source
mappings.

Change-Id: Ib0b337ef5d4b5b8cd9f6e1d7c5c19a770b53e0e8
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
Sergio Martins 2012-02-02 17:00:13 +00:00 committed by Qt by Nokia
parent 8eab9cbce2
commit 2614e16c41
2 changed files with 10 additions and 0 deletions

View File

@ -316,6 +316,15 @@ int QIdentityProxyModel::rowCount(const QModelIndex& parent) const
return d->model->rowCount(mapToSource(parent));
}
/*!
\reimp
*/
QVariant QIdentityProxyModel::headerData(int section, Qt::Orientation orientation, int role) const
{
Q_D(const QIdentityProxyModel);
return d->model->headerData(section, orientation, role);
}
/*!
\reimp
*/

View 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;