[SOLVED] Combobox styling
-
wrote on 25 May 2015, 13:51 last edited by xumuk 6 Feb 2015, 08:20
How to use ComboboxStyle::background property? I tried this but it`s not working
Rectangle { id: mainRect width: 500 height: 500 ListModel{ id: dataModel ListElement{ text: "Day" } ListElement{ text: "Week" } ListElement{ text: "Month" } ListElement{ text: "Year" } } ComboBox { id: box model: dataModel style: ComboBoxStyle{ background: Rectangle{ color: "red" } label: Text{ text: control.currentText } } anchors.centerIn: parent } }
I see only text in output (not clickable). What i`m doing wrong?
-
How to use ComboboxStyle::background property? I tried this but it`s not working
Rectangle { id: mainRect width: 500 height: 500 ListModel{ id: dataModel ListElement{ text: "Day" } ListElement{ text: "Week" } ListElement{ text: "Month" } ListElement{ text: "Year" } } ComboBox { id: box model: dataModel style: ComboBoxStyle{ background: Rectangle{ color: "red" } label: Text{ text: control.currentText } } anchors.centerIn: parent } }
I see only text in output (not clickable). What i`m doing wrong?
@xumuk Provide
implicitWidth
andimplicitHeight
for theRectangle
.implicitWidth: 120 implicitHeight: 20
-
How to use ComboboxStyle::background property? I tried this but it`s not working
Rectangle { id: mainRect width: 500 height: 500 ListModel{ id: dataModel ListElement{ text: "Day" } ListElement{ text: "Week" } ListElement{ text: "Month" } ListElement{ text: "Year" } } ComboBox { id: box model: dataModel style: ComboBoxStyle{ background: Rectangle{ color: "red" } label: Text{ text: control.currentText } } anchors.centerIn: parent } }
I see only text in output (not clickable). What i`m doing wrong?
@xumuk Please mark it as solved if it worked so that others may understand that it has solution.
1/3