Results 1 to 3 of 3

Thread: QCompleter + QSqlTableModel problem

  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default QCompleter + QSqlTableModel problem

    Hi,

    for a QLineEdit I set up a QCompleter with an QSqlTableModel, which works for the letter 'a'. When I enter a 'b', I get no completions, but when I scroll in a QTableView with the same model to 'b', then the QCompleter also displays completions.

    So I guess the QCompleter only works with the initial read items of the model. How to tell QCompleter to work with the whole Table (~ 59.000 items)?

    Thanks,
    Lykurg

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QCompleter + QSqlTableModel problem

    The model is probably trying to delay fetching all the rows as long as possible to minimise the latency needed to initialise itself. You might try manually accessing the last item from the model. It might force it to fetch all the remaining elements.

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QCompleter + QSqlTableModel problem

    Yes, by forcing the model to load all data via
    Qt Code:
    1. while ( model->canFetchMore() )
    2. model->fetchMore();
    To copy to clipboard, switch view to plain text mode 
    all works fine, but in that case a QStringListModel with fetching the database fields by hand is better. (VmRSS is up to 2000 kB smaller)

    Lykurg

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.