Results 1 to 2 of 2

Thread: How to update the QCompleter complete list dynamically?

  1. #1
    Join Date
    Feb 2012
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question How to update the QCompleter complete list dynamically?

    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?

  2. #2
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to update the QCompleter complete list dynamically?

    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--->

    Qt Code:
    1. completer=new QCompleter("yourstringlist",this); //Here add your own stringlist containing the data of the database.
    To copy to clipboard, switch view to plain text mode 
    and set it to the line edit.

Similar Threads

  1. update the view dynamically
    By rimie23 in forum Qt Programming
    Replies: 10
    Last Post: 10th June 2012, 23:31
  2. Replies: 0
    Last Post: 25th July 2011, 14:11
  3. Replies: 4
    Last Post: 21st January 2011, 01:27
  4. Replies: 1
    Last Post: 29th November 2010, 17:22
  5. Update complete notification?
    By dingetje in forum Qt Programming
    Replies: 0
    Last Post: 27th May 2009, 11:07

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.