有一个名为customSortFilterProxyModel的类继承自QSortFilterProxyModel。并且一个保护函数filterAcceptsRow是覆盖。 但是,filterAcceptsRow根本不被调用。会是什么? 谢谢。使用这种代理模型为什么filterAcceptsRow从QSortFilterProxyModel继承时不被调用?
QStringListModel *newModel = new QStringListModel;
QStringList strList;
strList << "1" << "2" << "3" << "4";
newModel->setStringList(strList);
customSortFilterProxyModel *m_customSortFilterProxyModel = new customSortFilterProxyModel(this);
m_customSortFilterProxyModel->setSourceModel(newModel);