View Full Version : How to set custom height for ListView & ComboBox items

28th September 2011, 08:56
I've developed a touch screen application in which user selects an item in qcombobox. Since it's touch screen, the height of each item is needed to be increased for easy selection of item in the combo. Even if I increase the height of qcombobox widget, the height of each item after dropdown remains same.

I'm looking for another option to create a qlistview & display the list on button press. Even in this case I'm unable to set the height of each item.

Please help me with this.
Thank you.

30th September 2011, 11:39
As to QComboBox you could try the following:
1. Set styled item delegate to your combobox:

combo->setItemDelegate( new QStyledItemDelegate );

2. Set style-sheet like the following:

QComboBox QAbstractItemView::item {
min-height : 32px;