Qt 6.11 is out! See what's new in the release
blog
QML reference by id. When works and when does not
QML and Qt Quick
4
Posts
2
Posters
2.0k
Views
2
Watching
-
Hello, guys
Following the two code examples. First shows working code and Second where we writestyle: comboBoxStyleIdshows not working code. Why when referencing by element's id we get error?//first ComboBox { id: combo anchors.centerIn: parent width: 200 model: [ "Banana", "Apple", "Coconut" ] style: ComboBoxStyle { id: comboBox background: Rectangle { id: rectCategory radius: 5 border.width: 2 color: "#fff" } }//second ComboBox { id: combo anchors.centerIn: parent width: 200 model: [ "Banana", "Apple", "Coconut" ] style: comboBoxStyleId ComboBoxStyle { id: comboBoxStyleId background: Rectangle { id: rectCategory radius: 5 border.width: 2 color: "#fff" } } -
Hello, guys
Following the two code examples. First shows working code and Second where we writestyle: comboBoxStyleIdshows not working code. Why when referencing by element's id we get error?//first ComboBox { id: combo anchors.centerIn: parent width: 200 model: [ "Banana", "Apple", "Coconut" ] style: ComboBoxStyle { id: comboBox background: Rectangle { id: rectCategory radius: 5 border.width: 2 color: "#fff" } }//second ComboBox { id: combo anchors.centerIn: parent width: 200 model: [ "Banana", "Apple", "Coconut" ] style: comboBoxStyleId ComboBoxStyle { id: comboBoxStyleId background: Rectangle { id: rectCategory radius: 5 border.width: 2 color: "#fff" } } -