Is it possible to binding "properties" ranther than "property" in Binding?
-
I'm writing
BindingforLoader's item. Let's start from my case after simplifying. Assuming thatCustomItemis an customized item that has properties namedprop1,prop2, and I use it asLoader's source component. When I want to initializeprop1andprop2inLoader, I have to do likeLoader { id: loader sourceComponent: comp Binding { target: loader.item property: "prop1" when: loader.status === Loader.Ready value: control.prop1 } Binding { target: loader.item property: "prop2" when: loader.status === Loader.Ready value: control.prop2 } }Is it possible to bind more value in one
Binding? Note that you cannotBinding { loader.item.prop1: control.prop1 loader.item.prop2: control.prop2 } -
I'm writing
BindingforLoader's item. Let's start from my case after simplifying. Assuming thatCustomItemis an customized item that has properties namedprop1,prop2, and I use it asLoader's source component. When I want to initializeprop1andprop2inLoader, I have to do likeLoader { id: loader sourceComponent: comp Binding { target: loader.item property: "prop1" when: loader.status === Loader.Ready value: control.prop1 } Binding { target: loader.item property: "prop2" when: loader.status === Loader.Ready value: control.prop2 } }Is it possible to bind more value in one
Binding? Note that you cannotBinding { loader.item.prop1: control.prop1 loader.item.prop2: control.prop2 }@Kamichanw
You could write a type that does that (inspect its own meta object, and bind properties declared in it to its target).Or you couse use an instantiator:
Instantiator { model: ["prop1", "prop2"] delegate: Binding { targer: loader.item property: modelData value: control[modelData] } } -
@Kamichanw
You could write a type that does that (inspect its own meta object, and bind properties declared in it to its target).Or you couse use an instantiator:
Instantiator { model: ["prop1", "prop2"] delegate: Binding { targer: loader.item property: modelData value: control[modelData] } } -
K Kamichanw has marked this topic as solved on