Tianchi
v0.0.2 build 20130701
C++ library for Qt with VC & mingW
|
依所设过滤参数(QVariantMap)来使用已设滤函数进行过滤的 SortFilterProxyModel,使用时分三部分: 更多...
#include <tcfunctionalsortfilterproxymodel.h>
Public 槽 | |
void | setFilterParam (const QVariantMap ¶m) |
设定过滤参数 | |
Public 成员函数 | |
TcFunctionalSortFilterProxyModel (QObject *parent=0) | |
void | setFilterFunction (TcFunctionalSortFilterProxyModelFilterFunction func) |
设定过滤函数 | |
Protected 成员函数 | |
virtual bool | filterAcceptsRow (int source_row, const QModelIndex &source_parent) const |
依所设过滤参数(QVariantMap)来使用已设滤函数进行过滤的 SortFilterProxyModel,使用时分三部分:
1. 定义过滤函数 2. 创建TcFunctionalSortFilterProxyModel实例,并设定过滤函数 3. 条件改变时,调用setFilterParam()应用过滤参数并使其生效
1.先定义过滤函数(示例为MyFilter)
2.创建模型时,设置过滤函数
3.设置完过滤条件后,调用setFilterParam()来应用过滤参数