Results 1 to 4 of 4

Thread: More completitions per lineedit?

  1. #1
    Join Date
    Aug 2007
    Posts
    244
    Thanks
    42
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default More completitions per lineedit?

    I'm asking if it is possible to call multiple times a completer on a QLineEdit after inserting a separator character. Let me explain with an example:

    Let's say we have

    Qt Code:
    1. QStringList wordList;
    2. wordList << "alpha" << "omega" << "omicron" << "zeta";
    3.  
    4. QLineEdit *lineEdit = new QLineEdit(this);
    5.  
    6. QCompleter *completer = new QCompleter(wordList, this);
    7. completer->setCaseSensitivity(Qt::CaseInsensitive);
    8. lineEdit->setCompleter(completer);
    To copy to clipboard, switch view to plain text mode 

    typing on the lineedit pops the completer; I choose one of the entry in the list, then type a delimeter character like ',' and start typing again triggering again the completer; here a mockup



    I dunno if a similar implementation was already adopted by any app; if so, please tell me which one.

    Very thanks
    Attached Images Attached Images
    Giuseppe CalÃ

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

    Default Re: More completitions per lineedit?

    You need a hierarchical model containing all permutations of the words and reimplement splitPath() using the separator of your choice.
    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
    Aug 2007
    Posts
    244
    Thanks
    42
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: More completitions per lineedit?

    Since my list will contain ~4K elements, do you think that the method you suggest is still applicable?

    Thanks
    Giuseppe CalÃ

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

    Default Re: More completitions per lineedit?

    Yes, it's applicable. Of course you have to generate the combinations on the fly instead of statically inserting all elements into the model.
    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.


Similar Threads

  1. LineEdit.
    By Rewo in forum Newbie
    Replies: 17
    Last Post: 2nd July 2010, 09:37
  2. Help on using QTableWidget with LineEdit.
    By narendra in forum Qt Programming
    Replies: 3
    Last Post: 31st December 2009, 15:30
  3. lineedit in qpainter
    By Devoraz in forum Newbie
    Replies: 9
    Last Post: 5th August 2009, 01:52
  4. How to update lineEdit
    By HelloDan in forum Qt Programming
    Replies: 9
    Last Post: 17th February 2009, 07:01
  5. Slots in LineEdit
    By Misko in forum Newbie
    Replies: 3
    Last Post: 28th July 2007, 13:36

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
  •  
Qt is a trademark of The Qt Company.