Qt World Summit: Register Today!

Need help: how to style the top and bottom edges of a combobox menu

  • Hello.
    Apologizes if this is explained somewhere, I searched everywhere and I could not come up with an answer.
    I have a stylesheet used to customize my application that customizes the comboboxes. The problem that I have is that there are two white bands at the top and bottom of the popup menu used for the combobox, no matter what I try to do to remove them or, even better, make them look like the rest of the menu.
    Here is my stylesheet:

    @QComboBox {
    border: 1px solid black;
    background-color: #606060;
    border-radius: 3px;
    min-width: 6em;
    selection-background-color: #ffa828;
    selection-color: black;

    QComboBox::drop-down {
    subcontrol-origin: padding;
    subcontrol-position: top right;

     border-left-width: 1px;
     border-left-color: darkgray;
     border-left-style: solid;


    QComboBox QAbstractItemView {
    padding-top: 0px;
    padding-bottom: 0px;
    background-color: #686868;

    And here is an example of how it shows:

    I want to make those two white bands assume the background color of the rest of the menu. Alternatively it woul dbe great to simply remove them.

    Thank you very much for any help that you can provide.

  • Hello. I'm just trying to refresh this thread to see if anybody has a solution. Any takers? Is this an unsolvable bug of Qt 4.8?
    Thanks in advance.

  • I have the same problem. It seems there is a default background behind QComboBox menu and it cannot be edited.

Log in to reply