[Qt-interest] QComboBox MaxVisibleItems set.

Malyushytsky, Alex alex at wai.com
Wed Feb 24 22:18:57 CET 2010


Have you tried top set max visible items to combobox, instead of completer?
combo-> setMaxVisibleItems(20);

Alex

From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of minsoub Jung
Sent: Wednesday, February 24, 2010 3:11 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] QComboBox MaxVisibleItems set.

OS : Linux
Qt  : 4.6.0

I tried setting MaxVisibleItems of QComboBox.

I tried coding something like :
Qt Code:
==================================================
QComboBox *combo = new QComboBox;
combo->setModel(queryModel);
combo->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);

// MaxVisibleItems set
QCompleter *p = new QCompleter(queryModel);
p->setMaxVisibleItems(20);
combo->setCompleter(p);
combo->show();
==================================================

The code execute, then QComboBox Size is overflowed and it's height
exceed screen size.
QComboBox item count is 300.

Why does't it display so MaxVisibleItem as I'm setting?

What is incorrect it?

please, Somebody help me.


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."

"Please consider our environment before printing this email."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100224/6052250d/attachment.html 


More information about the Qt-interest-old mailing list