QT lineEdit自动补全

版权声明:本文为博主原创文章,未经博主允许不得转载。 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);

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_33308135/article/details/82897297