I tried setting MaxVisibleItems of QComboBox.

I tried coding something like :
Qt Code:
  1. QComboBox *combo = new QComboBox;
  2. combo->setModel(queryModel);
  3. combo->view()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
  4.  
  5. // MaxVisibleItems set
  6. QCompleter *p = new QCompleter(queryModel);
  7. p->setMaxVisibleItems(20);
  8. combo->setCompleter(p);
  9. combo->show();
To copy to clipboard, switch view to plain text mode 

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

Why don't display so MaxVisibleItem as I'm setting?

What's incorret?

please, Somebody help me.