Skip to content

Fix QComboBox item margins under Qt 6

Luke Horwell requested to merge lahseven/breeze:fix_qcombobox_item_height into master

A very trivial correction to the margins for QComboBox items under Qt 6.

I noticed for a while that something was off in QtWidget-based applications where the dropdown lists for a combo box were vertically longer. Upon investigation, it would appear this might be how Qt 6 interprets the margins. Looking at the history, the constants were not tweaked, so I assume it wasn't intentional and could just be a late regression from the Qt 6 port.

image.png

(Menu bar items shown for reference)

After this change, Qt 5 and Qt 6 QtWidget-based apps co-existing together will now have similar margins when using the combo box. It'll also prevent margins from being accidentally unintentionally changed in future since the constant was originally shared for items like those in a QTreeView, which are currently nicely spaced as they are.

I noticed the amiss using KSysGuard (Qt 6 port):

Before After

image.png

Combo items vs menu items

image.png

6 vs 7 items

Edited by Luke Horwell

Merge request reports

Loading