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 auto Selection Row
Qt 6.11 is out! See what's new in the release blog

QCompleter auto Selection Row

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 661 Views 1 Watching
  • 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.
  • Q Offline
    Q Offline
    Qt.Jo.Ha
    wrote on last edited by
    #1

    hello. i have a QCompleter and TableView

    453647bb-0238-4f51-b331-fb075f74cd2d-image.png

    If I type A in LineEdit, I want the Auto Selection to be A in PopupView.

    Even if you change the view selection with the arrow keys, I don't want it to be applied to LineEdit the same way, and I want it to be applied only when I return.

    What should I do?

    JonBJ 1 Reply Last reply
    0
    • Q Qt.Jo.Ha

      hello. i have a QCompleter and TableView

      453647bb-0238-4f51-b331-fb075f74cd2d-image.png

      If I type A in LineEdit, I want the Auto Selection to be A in PopupView.

      Even if you change the view selection with the arrow keys, I don't want it to be applied to LineEdit the same way, and I want it to be applied only when I return.

      What should I do?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Qt-Jo-Ha
      I am a bit slow, so I don't always understand user questions as quickly as some of the other respondents here... !

      First: am I right in thinking is that the left-hand view is how you want it and the right-hand view is how it behaves at present? Or is that not the case?

      Second: if that is the case, am I right that what you show indicates that plain letter A is not initially in the QCompleter's completion list? The list only has (matching) AB & ABC in it? So what you want is to be offered what you have typed so far, whether it's in the list or not, plus what is actually matching in the list?

      Then you press Return when you're ready on your selection. The item you pick might be one in the list, or it might be what you typed so far, even if it's not in the list?

      Q 1 Reply Last reply
      0
      • JonBJ JonB

        @Qt-Jo-Ha
        I am a bit slow, so I don't always understand user questions as quickly as some of the other respondents here... !

        First: am I right in thinking is that the left-hand view is how you want it and the right-hand view is how it behaves at present? Or is that not the case?

        Second: if that is the case, am I right that what you show indicates that plain letter A is not initially in the QCompleter's completion list? The list only has (matching) AB & ABC in it? So what you want is to be offered what you have typed so far, whether it's in the list or not, plus what is actually matching in the list?

        Then you press Return when you're ready on your selection. The item you pick might be one in the list, or it might be what you typed so far, even if it's not in the list?

        Q Offline
        Q Offline
        Qt.Jo.Ha
        wrote on last edited by
        #3

        Thank you for answer @JonB

        The first picture and the second picture are all pictures I want. If there are A, AB, and ABC in the information of ViewModel, input A and all 3 will appear.

        In the photo, as soon as you type and the PopUp View comes out, you can see that it is highlighted in the first row, but the current operation is not.

        The current behavior is that when you type A, the first row is not highlighted, and if you change the row selection using the arrow keys, the text in LineEdit changes according to the SelectRow.

        The action I want is that Selection is automatically set to A when A is entered, and I don't want the Text to change when the Select Row is changed with the arrow keys.

        1 Reply Last reply
        0

        • Login

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