[Qt-interest] Scroll Fetching with QSortFilterProxyModel

Willy P willy.lists at gmail.com
Tue Aug 31 01:20:42 CEST 2010


Hey,
I have a QSqlQueryModel attached to and SQLite DB that produces a
large result.  Between it and the view, I have a QSortFilterProxy
model that dramatically reduces the output.

[BIG QUERY] -> [FILTER] -> [VIEW]

As I scroll in the view, it loads more data on the fly.  I really like
this behavior.  But my question is this:

If the view is mostly empty BUT there are valid results that are not
yet fetched, how can I get the view to "demand more."

I don't want to use:

while( model->canFetchMore() ) { model->fetchMore(); }

B/c it actually reads the data into memory.

The "scroll fetching" seems to just seek ahead in the query until it
gets a hit.  How can I tell the model to keep seeking for more hits
w/o reading the results of the entire query into RAM?

I appreciate any advice you have...

Thanks...

-Willy



More information about the Qt-interest-old mailing list