Search code examples
qtqcomboboxqtstylesheets

How to avoid overlapping of items in a QComboBox dropdown, with a large font size


I would like to use a large font size with a QComboBox. I tried setting the font-size using a style-sheet:

*{font-size: 22pt}

This does change the font size, but the spacing between the items in a QComboBox drop-down end up overlapping. How can I get a large font and also get the proper row spacing?


Solution

  • Styles for the drop down of a QComboBox can be changed by applying relevant changes to QComboBox QAbstractItemView as showed in the following example:

    QComboBox QAbstractItemView
    {
       color:#ccc;
       background-color:#333;
       border:none;
       selection-background-color:#1c1c1c;
       selection-color: #ccc; 
       height: 30px;
    }