View Full Version : QCompleter + SQL

Wild Pointer
28th August 2012, 19:35
hi Qt community
i'm looking for the way of implementing dynamic QCompleter.
let me explain what i need :)
i have a phonebook table (in MySQL) with `name`,`phoneNumbers` columns and it contains about 30,000 records (so i can't simply use QCompleter with a QStringList or something like that).
so, i need a textbox that send a query to the database (with textchanged signal for example) and probably a code that updates QCompleter with the query's result and shows the suggestions(like AJAX completers in the web).
1.user type key "s" into the textbox.
2.a query "SELECT blablabla WHERE LIKE %".(only records starting with the s character)
3.textbox shows the suggestions.("stan","smith","steve","...")
4.done :D

and after all, my QLineEdit is in the custom ItemView table,so i can't use subclassed QLineEdit.


Wild Pointer
1st September 2012, 11:18
any ideas after 3days ?