Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt Quick Controls 2: Combobox Indicator Location



  • Hello,
    Does anyone know how one can go about moving the right hand combobox dropdown indicator to the left of the control? I have tried changing the x position of the indicator but this only moved the indicator display component, not the clickable region. Here's the relevant snippet:

    ComboBox {
        id: combo
    
        ....
    
        property string placeholderText: ""
        property bool indicatorRight: true
    
        anchors.fill: parent
        editable: true
        editText: placeholderText
        model: options
        palette { text: "white"; highlight: "black" }
        font { pointSize: 14; styleName: "Helvetica"; weight: Font.Medium }
    
        indicator: Image {
            height: combo.height - 10; width: height
            x: indicatorRight ? combo.width - width : 0;
            y: 5
            source: "qrc:/Images/images/menu_dots_white.png"
        }
    
        ....
    
    }
    

    Thanks in advance.



  • Nvm, sorta jumped the gun with the question. Haven't looked at the source, but by inspection it seems the ComboBox's content view covers the underlying mouse area that is used to access the menu.

    Setting the rightPadding and leftPadding of the ComboBox appropriately uncovers the clickable region on that side of the ComboBox, so, for example, setting rightPadding to 10 gives a 10px wide clickable region on the right, and likewise for the left.



  • Nvm, sorta jumped the gun with the question. Haven't looked at the source, but by inspection it seems the ComboBox's content view covers the underlying mouse area that is used to access the menu.

    Setting the rightPadding and leftPadding of the ComboBox appropriately uncovers the clickable region on that side of the ComboBox, so, for example, setting rightPadding to 10 gives a 10px wide clickable region on the right, and likewise for the left.


Log in to reply