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

Make QCompleter more extensible

    XMLWordPrintable

Details

    Description

      QCompleter is a very useful tool, but it is unfortunately not extensible as application developers may (and do) need.
      For example the very essential string comparisition for the filtering is not overridable, limiting the usecases for QCompleter drastically. The completer only searches at the beginning of the haystack.

      Making that method virtual should now be impossible because of binary compatibility...

      But what is IMHO nicer, anyway: an optional custom filterProxyModel could be given to the completer in order to optionally outsource the filtering. What about that? If no filterProxyModel is provided, the bahavior remains as always.

      In Creator development, we had two situations where we would have liked to use the completer as it is, but couldn't because of the limitations. Reimplementing the event voodoo each time in order to have two widgets focussed "at once" like in the QCompleter is not an option

      Discussion:
      QCompleter pops up the items which the typed in string is a prefix of. That "beginsWidth" search is very limited and reduces the usability of QCompleter. This tasks suggests that it should be possible to pass in a custom filter which does for example a RegEx or a similarity search in order to pop up the items. That filter could even take care for the sorting.

      Attachments

        Issue Links

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

          Activity

            People

              smd Jan Arve
              portale Alessandro Portale
              Votes:
              34 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes