QComboBox dropdown Height
Version : Qt 4.6.0
OS : Linux
I tried setting QComboBox Height.
Qt Code :
Code:
....
cbo->clear();
cbo->setModel(model);
cbo->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
cbo->view()->setFixedHeight(100);
If it's code execute, then QComboBox's area overflowed in window screen.
Any suggestions?
( please show to me the short example ...
I'm beginer Qt.
)
Thanks.
Re: QComboBox dropdown Height
Quote:
Originally Posted by
minsoub
( please show to me the short example ...
I'm beginer Qt.
)
Then you should use our Newbie section... See QComboBox::completer() and QCompleter::setMaxVisibleItems().
Re: QComboBox dropdown Height
First of all, thanks to your answer.
I tried coding something like :
QComboBox *cbo = new QComboBox;
QSqlQueryModel *model = new QSqlQueryModel;
....
cbo->clear();
cbo->setModel(model);
cbo->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded) ;
QCompleter *p = new QCompleter(icao_cdModel);
p->setMaxVisibleItems(20);
cboIcao_cd->setCompleter(p);
-----------------------------------------------------------------------------------------
but the results is equlas above question.
Please show to me detail the solution.
thanks.