Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QCompleter: Multiple words in one line, want completion on each word individually

QCompleter: Multiple words in one line, want completion on each word individually

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 4 Posters 2.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mamegohan
    wrote on last edited by
    #1

    Hi,

    I'm using QCompleter to complete words in a QLineEdit. The lineedit handles the input to a command-line interface (built on AngelScript), so I must support lines like:
    Item i = Item("ItemName");
    and similar.

    I've collected all keywords and identifiers in a QStringListModel and set that as the completion model. If I type

    Ite
    

    I will get "Item" suggested to me. However, if I continue typing:

    Item ite
    

    I do not get a suggestion for the second word. I'd be grateful for any ideas on how to do this.

    Thanks in advance!

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      The default operation will not do that I think as it see full text and dont know
      u want only the newly typed.
      The functionality you are after seems to be very like
      http://doc.qt.io/qt-5/qtwidgets-tools-customcompleter-example.html

      M 1 Reply Last reply
      0
      • mrjjM mrjj

        Hi
        The default operation will not do that I think as it see full text and dont know
        u want only the newly typed.
        The functionality you are after seems to be very like
        http://doc.qt.io/qt-5/qtwidgets-tools-customcompleter-example.html

        M Offline
        M Offline
        Mamegohan
        wrote on last edited by
        #3

        @mrjj

        Thanks for the link! I will give it a shot.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rohrlich
          wrote on last edited by
          #4

          If you have found the answer I would love to know it!

          kshegunovK 1 Reply Last reply
          0
          • R rohrlich

            If you have found the answer I would love to know it!

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on last edited by kshegunov
            #5

            The answer is to write your custom completer. See @mrjj's link for details.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            2

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved