In the help :
If filterMode is set to Qt::MatchStartsWith , only those entries will be displayed. Qt::MatchContains Qt::MatchEndsWith the ones that end up with the typed characters.
what is translated:
If the filtering mode is set to Qt::MatchStartsWith , then elements starting with the search string will be Qt::MatchStartsWith . If Qt::MatchContains , then contain the desired. Well, if Qt::MatchEndsWith , then only those that end in it.
Accordingly, if you need to search for strings containing the desired character set, then set the Qt::MatchContains :
componentsCompleter = new QCompleter(componentsModel,this); componentsCompleter->setCaseSensitivity(Qt::CaseInsensitive); componentsCompleter->setFilterMode(Qt::MatchContains); componentsCompleter->setCompletionColumn(componentsModel->fieldIndex("item"));