FAster approach for Completetion
Hello Friends,
I experiment with the standard approach for implementing QCompleter in a QLineEdit.
But when the wordlist grows up to 20000 or more the delay before the popup widget for completetion comes ist to long.
Is there another aproach for implementing completetion with big amount of words?
Re: FAster approach for Completetion
Are you using a QStringListModel? If so, create a SQLite database in the memory, or if the wordlist wont change on your disk, and use that with a QSqlTableModel. This will speed up the process.
Re: FAster approach for Completetion
Someone should really write a completer class based on a suffix (or prefix) tree...
Re: FAster approach for Completetion
I use this:
Code:
completer
->setCompletionMode
(QCompleter::PopupCompletion);
qle_myLineEdit->setCompleter(completer);
Re: FAster approach for Completetion
then, as told, try to use a sqlite database.
Re: FAster approach for Completetion
so now I implement this one:
Code:
model->setTable("mytable");
model->select();
completer
->setCompletionMode
(QCompleter::PopupCompletion);
completer->setCompletionColumn(0);
qle_myLineEdit->setCompleter(completer);
now the delay is ca. 0.3 seconds by 40000 words feels ok or exists there a better approach??
Re: FAster approach for Completetion
You can implement your own completer class based on Patricia trie and optionally populated in a worker thread with caching completion traces (so that removing the last character of completion prefix doesn't cause the completion list to be rebuilt). That's pretty much maximum you can squeeze from a completer mechanism.
Re: FAster approach for Completetion
Re: FAster approach for Completetion
Quote:
Originally Posted by
codeman
Patricia trie ???????
Google is your friend: http://en.wikipedia.org/wiki/Radix_tree!