attached file : QComboBox capture.
apply code
// ICAO CD
cboIcao_cd->clear();
cboIcao_cd
->setModel
(ComboDataCollection
::getInstance().
getTableModel(icao_cdModel,
"TB_CNTRYCD",
QStringList() <<
"ICAO_CD"));
cboIcao_cd->setModelColumn(0);
// Combo box Height
cboIcao_cd->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
p
->setCompletionMode
(QCompleter::PopupCompletion);
p->setMaxVisibleItems(20);
cboIcao_cd->setCompleter(p);
cboIcao_cd->show();
// ICAO CD
cboIcao_cd->clear();
cboIcao_cd->setModel(ComboDataCollection::getInstance().getTableModel(icao_cdModel, "TB_CNTRYCD", QStringList() << "ICAO_CD"));
cboIcao_cd->setModelColumn(0);
// Combo box Height
cboIcao_cd->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
QCompleter *p = new QCompleter(icao_cdModel);
p->setCompletionMode(QCompleter::PopupCompletion);
p->setMaxVisibleItems(20);
cboIcao_cd->setCompleter(p);
cboIcao_cd->show();
To copy to clipboard, switch view to plain text mode
The code execute, then QComboBox size is overflowed , like attached file.
What is incorrect it?
If someone has a simple example I'd greatly appreciate it.
Bookmarks