Sparhawk
17th December 2011, 17:58
Hi All,
I have an issue, and maybe you can suggest me a workaround. I have implemented a QAbstractItemModel that can have a huge amount of rows (several thousands) that are fetching from database on demand. I subclass QSortFilterProxyModel, to give dynamic filters. All data is show on QTableView. I'm using Qt 4.7.3.
Suppose this sequence: I set the model for QTableView to be QSortFilterProxyModel. QTableView is then show to user. Internally, QTableView on paintEvent, has a call to QSortFilterProxyModel::index(row, column, parent) that, internally, has a call to d->create_mapping (Qt sources), that force QSortFilterProxyModel to fetch all rows calling to filterAcceptsRow.
It is supossed that QTableView only needs to call to QSortFilterProxyModel to get the visible rows using, rowCount from QSortFilterProxyModel, but "index" on QSortFilterProxyModel is fetching all rows... Is there any solution to that? Maybe am I using a wrong idea? The only solution I see is reimplement all QSortFilterProxyModel with my own mapping source-proxy.
Thanks a lot!!!
I have an issue, and maybe you can suggest me a workaround. I have implemented a QAbstractItemModel that can have a huge amount of rows (several thousands) that are fetching from database on demand. I subclass QSortFilterProxyModel, to give dynamic filters. All data is show on QTableView. I'm using Qt 4.7.3.
Suppose this sequence: I set the model for QTableView to be QSortFilterProxyModel. QTableView is then show to user. Internally, QTableView on paintEvent, has a call to QSortFilterProxyModel::index(row, column, parent) that, internally, has a call to d->create_mapping (Qt sources), that force QSortFilterProxyModel to fetch all rows calling to filterAcceptsRow.
It is supossed that QTableView only needs to call to QSortFilterProxyModel to get the visible rows using, rowCount from QSortFilterProxyModel, but "index" on QSortFilterProxyModel is fetching all rows... Is there any solution to that? Maybe am I using a wrong idea? The only solution I see is reimplement all QSortFilterProxyModel with my own mapping source-proxy.
Thanks a lot!!!