0

而不是做这样的事情:(proxyModel 是一个 QSortFilterProxyModel)

proxyModel->setFilterRegExp(".*");

有没有正确的方法来清除过滤器?因为那在我看来是错误的。

4

1 回答 1

6

From the filterRegExp property docs:

If no QRegExp or 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.

于 2013-01-13T08:28:23.340 回答