ComboBoxStyle trouble changing style
-
I don't see the changed background and I have no clue how to change the arrow and delegates afterwards..
ComboBox { anchors.left: parent.left anchors.leftMargin: 20 currentIndex: 0 model: ListModel { ListElement { text: "Test1"; } ListElement { text: "Test2"; } } style: ComboBoxStyle { background: Rectangle { color: "red" anchors.fill: parent } label: Label { text: control.currentText color: "blue" font.pointSize: 16 } } }
Thanks for any help!
-
Hi @Pheelbert,
if you meant changing the background of dropdown list then you will need to do it in__dropDownStyle
private property for now.
eg: insideComboBoxStyle
__dropDownStyle: MenuStyle { itemDelegate.label: Text { width:200 height: 80 color: "blue" text: styleData.text } itemDelegate.background: Rectangle { color: styleData.selected ? "darkGray" : "transparent" } }
And to add an arrow you can just use an
Image
inside thebackground: Rectangle {
component.