PDA

View Full Version : How to update the QCompleter complete list dynamically?



premkumar
2nd July 2012, 17:14
Hello,
I have line edit control in one of my forms. It is auto completed by a values fetched from a column in a database table. I did exactly to this stage and my form worked as expected.

I also update the database table in the same form. So new values in the database table is not updated to the completer list of the edit control. How to update the completer list, so that the new added values are used to auto complete the line edit control?

sonulohani
4th July 2012, 12:17
kkk,, create one stringlist, and store all the data from the columns into the string list and set the stringlist to the completer like this--->



completer=new QCompleter("yourstringlist",this); //Here add your own stringlist containing the data of the database.

and set it to the line edit.