QCompleter + QSqlTableModel problem
Hi,
for a QLineEdit I set up a QCompleter with an QSqlTableModel, which works for the letter 'a'. When I enter a 'b', I get no completions, but when I scroll in a QTableView with the same model to 'b', then the QCompleter also displays completions.
So I guess the QCompleter only works with the initial read items of the model. How to tell QCompleter to work with the whole Table (~ 59.000 items)?
Thanks,
Lykurg
Re: QCompleter + QSqlTableModel problem
The model is probably trying to delay fetching all the rows as long as possible to minimise the latency needed to initialise itself. You might try manually accessing the last item from the model. It might force it to fetch all the remaining elements.
Re: QCompleter + QSqlTableModel problem
Yes, by forcing the model to load all data via
Code:
while ( model->canFetchMore() )
model->fetchMore();
all works fine, but in that case a QStringListModel with fetching the database fields by hand is better. (VmRSS is up to 2000 kB smaller)
Lykurg