当前位置: 代码迷 >> QT开发 >> QSortFilterProxyModel数据统计解决方法
  详细解决方案

QSortFilterProxyModel数据统计解决方法

热度:389   发布时间:2016-04-25 02:59:58.0
QSortFilterProxyModel数据统计
经过QSortFilterProxyModel过滤后的数据怎么访问?
比如说,源Model中有500条数据,使用QSortFilterProxyModel过滤后,我怎么能够知道经过过滤后还剩余多少条数据?怎么才能访问过滤后的结果数据呢?
谢谢!
------解决思路----------------------
QModelIndex QSortFilterProxyModel::mapToSource ( const QModelIndex & proxyIndex ) const [virtual]

Reimplemented from QAbstractProxyModel::mapToSource().

Returns the source model index corresponding to the given proxyIndex from the sorting filter model.

QModelIndex QSortFilterProxyModel::mapFromSource ( const QModelIndex & sourceIndex ) const [virtual]

Reimplemented from QAbstractProxyModel::mapFromSource().

Returns the model index in the QSortFilterProxyModel given the sourceIndex from the source model.
  相关解决方案