Results 1 to 5 of 5

Thread: QCompleter performance for large data models

  1. #1
    Join Date
    May 2014
    Posts
    5
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default QCompleter performance for large data models

    I was working with the completer example( that comes with Qt installation; C:\Qt\Qt5.3.0\Examples\Qt-5.3\widgets\tools\completer). It was working fine for the small text file wordlist.txt.But if I change wordlist.txt file with a textfile which has 200k words then there are significant delay in the popup completion box showing up. How do I remove this delay and show up the popup box instantly?( I need to show only 100 results in the popup box in every keystrokes in the QLineEdit.

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

    Default Re: QCompleter performance for large data models

    I'm afraid you'll have to build your own completer tailored for your model characteristics. Going through 200k entries takes time, you have to reduce that time somehow (e.g. using some kind of trie if your usecase allows it).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2014
    Posts
    5
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QCompleter performance for large data models

    I have done that for a DOTNET based project where the data is fetched from a List<string> and shown up in a ListBox almost instatly(250K words). However in DotNet there is a BeginUpdate and EndUpdate method of the ListBox so that the updation of the ListBox with new results while the user types is smooth. Is there any equivalent method for QListView?

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

    Default Re: QCompleter performance for large data models

    Updating of the view is unlikely the problem, filtering the model is the bottleneck. Apparently upon each change in the text the whole model is refiltered. What you need to do is either track changes or provide a faster than linear way of filtering the model. Unfortunately the latter cannot be done by subclassing QCompleter so you will have to provide your own completer class for that.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    jpmgr (9th June 2014)

  6. #5
    Join Date
    Nov 2010
    Posts
    46
    Thanks
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QCompleter performance for large data models

    You can find FULL solution for such situation here: http://stackoverflow.com/a/33454284/630169

Similar Threads

  1. Replies: 1
    Last Post: 3rd November 2011, 23:17
  2. Replies: 9
    Last Post: 11th April 2011, 11:05
  3. QTextEdit Performance handling large paragraphs
    By netuno in forum Qt Programming
    Replies: 14
    Last Post: 1st September 2010, 23:58
  4. High performance large file reading on OSX
    By mikeee7 in forum Qt Programming
    Replies: 2
    Last Post: 15th October 2009, 15:18
  5. Replies: 1
    Last Post: 23rd December 2008, 16:42

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.