I want to style my QComboBox with margin for the drop down items. This is how it looks like now:

And I would like something like this:

I tried with
QComboBox QAbstractItemView::item {
margin: 3px;
}
but it doesn't work.
Can you help me with this?
You want set some space between items.I try different stylesheets, but I can't get result. But I found this solution. Maybe 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}");
Result is very similar

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With