版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_33308135/article/details/82897297
#include <QCompleter>
QStringList strlist;
strlist<<"Qt"<<"Qt Create"<<tr("你好");
QCompleter *completer = new QCompleter(strlist,this);
completer->setCaseSensitivity(Qt::CaseInsensitive);
ui->lineEdit->setCompleter(completer);