Hey @all,
how can I set the row height in a QListView?
With a QTableView i can use setRowHeight() but how i can do it with a QListView?
LG NoRulez
Printable View
Hey @all,
how can I set the row height in a QListView?
With a QTableView i can use setRowHeight() but how i can do it with a QListView?
LG NoRulez
Either set the size using the SizeHintRole of the model or provide your own item delegate with reimplemented sizeHint().
Can i set rowsize using Stylesheet of QListWidget??
Use the ::item sub-control for QListWidget.
Thanks wysota, but it doesn't work for me when I'm trying to customize row height for combo box popup.
Actually stylesheet reference recommends to do it via "QComboBox QAbstractItemView" selector, but
"QComboBox QAbstractItemView::item" doesn't custom anything.
I suggested that ::item subcontrol is available only for concrete QAbstractItemView subclasses, not for
QAbstractItemView itself. I read qt code and found that QComboBox uses QComboBoxListView class which
is a subclass of QListView. So I tried to use "QComboBox QListView::item", but it doesn't work too.
I solved my problem with a help of this class:
Code:
class CComboBoxPopupItemDelegate : public QStyledItemDelegate { public: : QStyledItemDelegate(parent) { } { } }
In client code:
Code:
view->setItemDelegate(new CComboBoxPopupItemDelegate(this))
Alas I coudn't find easier solution.