Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
4.3.2, 5.11
-
None
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
- depends on
-
QTCREATORBUG-1 Locator popup not usable with mouse (on Windows)
- Closed
- relates to
-
QTBUG-3414 Substring completion
- Closed
- replaces
-
QTBUG-1200 Make QCompleter more extensible
- Closed
-
QTBUG-2447 Allow better customization of QCompleter
- Closed