Results 1 to 2 of 2

Thread: completion mode when obtaining index with QCompleter using QLineEdit

  1. #1
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question completion mode when obtaining index with QCompleter using QLineEdit

    I configured a QLineEdit with a list of names. I can get the completer to work correctly when using QCompleter::UnfilteredPopupCompletion, i.e. the activated(QModelIndex indx) provides me with the correct index with the indx.row() method. However, if I change the CompletionMode, to QCompleter::PopupCompletion then the row() method doesn't provide the 'absolute' index into my list, but rather a 'relative' (for lack of better description) as it indicates the index of the current possible matches. How do I get the same index as in the case of UnfilteredPopupCompletion when typing the same name?

  2. #2
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: completion mode when obtaining index with QCompleter using QLineEdit

    never mind...
    I took another look at the Completer example and I think I should just use a QStandardItemModel with an additional column for use as index and not show it.
    I'll report back when I get it to work.

Similar Threads

  1. How to change completion rule of QCompleter
    By freud in forum Qt Programming
    Replies: 8
    Last Post: 14th July 2021, 17:22
  2. Replies: 4
    Last Post: 21st January 2011, 01:27
  3. QLineEdit + QCompleter: returnPressed signal
    By thefriedc in forum Qt Programming
    Replies: 2
    Last Post: 21st September 2010, 16:21
  4. QCompleter multiple completion modes
    By chezifresh in forum Qt Programming
    Replies: 0
    Last Post: 12th March 2010, 22:25
  5. How to enable completion by symbols \s \t \n in QLineEdit?
    By NameSurname in forum Qt Programming
    Replies: 7
    Last Post: 21st October 2007, 20:39

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.