简体   繁体   English

如何在 QSortFilterProxyModel 中获取过滤的 rowCount

[英]How to get filtered rowCount in a QSortFilterProxyModel

I use a QSortFilterProxyModel to filter a QSqlTableModel's data, and want to get the filtered rowCount.我使用 QSortFilterProxyModel 来过滤 QSqlTableModel 的数据,并希望获得过滤后的 rowCount。

But when I call the QSortFilterProxyModel.rowCount method, the QSqlTableModel's rowCount was returned.但是当我调用 QSortFilterProxyModel.rowCount 方法时,返回了 QSqlTableModel 的 rowCount。

So how can I get the filtered rowcount?那么我怎样才能得到过滤后的行数呢?

您应该在设置QSortFilterProxyModel过滤器后调用proxymodel.rowCount

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM