有一個名爲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);