0
votes

There is a very small combobox in my layout. Is it possible to increase the size for the elements when the combobox is established? The box itself shall stay small.

Example

1

1 Answers

1
votes

The QML controls are fully customizable, so you can create your own view, for example:

ComboBox {
    id: control
    anchors.centerIn: parent
    model: ["First", "Second", "Third"]
    background: Rectangle {
        color: "lightgrey"
        border {width: 1; color: "grey"}
        implicitWidth:  50
        implicitHeight: 30
    }
    contentItem: Label {
        text: control.currentText.charAt(0)
        font: control.font
        padding: 4
        verticalAlignment: Text.AlignVCenter
    }
    popup: Popup {
        y: control.height - 1
        width: 200
        implicitHeight: contentItem.implicitHeight
        contentItem: ListView {
            clip: true
            implicitHeight: contentHeight
            model: control.popup.visible ? control.delegateModel : null
            currentIndex: control.highlightedIndex
        }
    }
}