QComboBox item height[Solved]

  • How do i give spacing in QComboBox items.

    Meaning if i want to increase the vertical gap between 2 items.

  • In the open list? You could use style sheet.
    Something like:

    QComboBox QAbstractItemView::item {
    margin-top: 2px;

    and set this style sheet on the combo box.

  • I want the gap between two lists items. Will the above style do that?

  • The above style issues an item of a QAbstractItemView inside a combo box, yes it will address the item. Whether margin is the correct property of the item, I'm not 100% sure, but I think it should do it. Try it out :-)

  • Yes this works.

  • then you should mark this thread as solved:

    click edit on your first post and add [Solved] in the title :-)

  • Hi all,

    I am also trying to access ::item of the ItemView of the QComboBox but

    QComboBox QAbstractItemView::item

    does not seems to work.

    I am using Qt 4.7.1 ... does someone successfully used ::item in this case ?

    Thanks in advance.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.