而不是做这样的事情:(proxyModel 是一个 QSortFilterProxyModel)
proxyModel->setFilterRegExp(".*");
有没有正确的方法来清除过滤器?因为那在我看来是错误的。
而不是做这样的事情:(proxyModel 是一个 QSortFilterProxyModel)
proxyModel->setFilterRegExp(".*");
有没有正确的方法来清除过滤器?因为那在我看来是错误的。
From the filterRegExp property docs:
If no
QRegExpor an empty string is set, everything in the source model will be accepted.
So the "proper" way of clearing the filter is to pass an empty string rather than a match-all regex.