[Qt-jambi-interest] QCompleter with QSqlQueryModel problem.

José Arcángel Salazar Delgado arcangel.salazar at gmail.com
Wed Aug 6 17:27:48 CEST 2008


Hi,

I'm Having some troubles trying to  set  a QCompleter into a QLineEdit.

This is what I´m Doing:

QComplete completer= new QCompleter();
completer.setModel(Familias.tableModel());
completer.setCompletionColumn(1);
ui.familiaLineEdit.setCompleter(completer);

The tableModel()  method return a QSqlQueryModel with the following query:

"SELECT id, nombre from familias"; //id is int, nombre is String

The expected behavior (I guess) it's that complete using "nombres", but 
instead, do something strange: The listView, display the ids, and when I 
select a number (id),  complete  the "nombre" String in the LineEdit.

I'm doing something bad,  or this is a bug?

Thanks for the help.



More information about the Qt-jambi-interest mailing list