- 讓QComboBox增加提示訊息(Placeholder text)?
- 使用者在QComboBox輸入內容,列出可能的選項?
圖一. 增加提示訊息 |
QLineEdit *placeholder=new QLineEdit;
placeholder->setPlaceholderText(QStringLiteral("請選擇縣市"));
ui->comboBox->setLineEdit(placeholder);
圖二. 列出可選的項目 |
QCompleter *com=new QCompleter(cityname);
com->setCaseSensitivity(Qt::CaseSensitive);
ui->comboBox->setEditable(true);
ui->comboBox->setCompleter(com);
延伸閱讀:
1. Qt入門篇(3):連結SQLITE資料
http://chenglearning.blogspot.tw/2013/11/qt3sqlite.html
0 comments:
張貼留言