QComboBox field markup
I want to create mine QComboBox
tagged for dropdowns. This is how it looks now:
And I would like something like this:
I tried with
QComboBox QAbstractItemView::item {
margin: 3px;
}
but that won't work.
Can you help me?
+3
Jacob krieg
source
to share
1 answer
You want to set some space between items.I try different stylesheets, but I can't get the result. But I found this solution. Perhaps it helps.
ui->comboBox->setView(new QListView());
ui->comboBox->setStyleSheet("QComboBox QAbstractItemView::item { min-height: 35px; min-width: 50px; }QListView::item:selected { color: black; background-color: lightgray}");
The result is very similar
+10
Chernobyl
source
to share