NComBox: refactored to follow the QML way, should help with bindings.

This commit is contained in:
quadbyte 2025-08-15 08:19:18 -04:00
parent a1cd673fb5
commit 3f3a13d254
8 changed files with 267 additions and 65 deletions

View file

@ -221,12 +221,40 @@ NLoader {
NComboBox {
label: "Animal"
description: "What's your favorite"
optionsKeys: ["cat", "dog", "bird", "monkey", "fish", "turtle", "elephant", "tiger"]
optionsLabels: ["Cat", "Dog", "Bird", "Monkey", "Fish", "Turtle", "Elephant", "Tiger"]
currentKey: "cat"
onSelected: function (value) {
console.log("[DemoPanel] NComboBox: selected ", value)
description: "What's your favorite?"
model: ListModel {
ListElement {
key: "cat"
name: "Cat"
}
ListElement {
key: "dog"
name: "Dog"
}
ListElement {
key: "bird"
name: "Bird"
}
ListElement {
key: "fish"
name: "Fish"
}
ListElement {
key: "turtle"
name: "Turtle"
}
ListElement {
key: "elephant"
name: "Elephant"
}
ListElement {
key: "tiger"
name: "Tiger"
}
}
currentKey: "dog"
onSelected: function (key) {
console.log("[DemoPanel] NComboBox: selected ", key)
}
}