标签:style blog class code java c
#include "widget.h" #include "ui_widget.h" #include <QtGui/QCompleter> #include <QStringList> Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); QStringList strings; strings << "Biao" << "Biao Huang" << "Mac" << "MacBook" << "MacBook Pro" << "Mac Pro"; completer = new QCompleter(strings, this); ui->comboBox->clear(); ui->comboBox->addItems(strings); ui->comboBox->setEditable(true); ui->comboBox->setCompleter(completer); } Widget::~Widget() { delete ui; delete completer; }
输入内容, 列出可选的项: QComboBox,布布扣,bubuko.com
标签:style blog class code java c
原文地址:http://www.cnblogs.com/wiessharling/p/3720879.html