Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-141593

Suggestion: Add Token filtering behavior in QComboBox with QCompleter

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.10.0
    • None
    • All

      I have an application that has a combo box with many entries. I want the user to select an entry and want to help them with a completer to narrow down selection as he types in the text. Works great as long as only one word is entered.
      I wanted to change the filtering to token filtering so that the entered text "apple red" would also match the "best apples are red apples" but I couldn't get it to do that because as soon as I enter the space sharacter this item is removed.
       
      Here is how I use the completer on my combo box:
       

      combo.completer = QtWidgets.QCompleter(arrayOfItems, parent)
      combo.completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
      combo.completer.setModelSorting(QtWidgets.QCompleter.CaseInsensitivelySortedModel)
      combo.completer.setCompletionMode(QtWidgets.QCompleter.PopupCompletion)
      combo.completer.setMaxVisibleItems(20)
      combo.setCompleter(self.completer)
        

      Best regards.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            iztokvirant Iztok Virant
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes