Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.12
-
None
Description
I believe this is a bug long present in Qt5, something similar (likely related) was reported in QTBUG-40442 back in '14 for Qt5.2.1.
In the combobox (not its dropdown), the contents appear to be placed a pixel or two too high.
This can nicely be seen by putting an icon into the combobox, as shown in the screenshot. There's a spacing of two pixels above and 5 pixels below the icon.
The expected behaviour is that there should be equal spacing below and above the icon, as it is in the dropdown.
Minimal code example
class Window(QMainWindow): def __init__(self): super().__init__() self.setWindowTitle("Python ") self.setGeometry(100, 100, 400, 200) self.UiComponents() self.show() def UiComponents(self): self.combo_box = QComboBox(self) self.combo_box.setGeometry(200, 100, 120, 30) geek_list = ["Geek", "Geeky Geek"] self.combo_box.addItems(geek_list) icon = QIcon("Grid.svg") self.combo_box.setItemIcon(0, icon) App = QApplication(sys.argv) window = Window() sys.exit(App.exec())