Qt 6.11 is out! See what's new in the release
blog
How to ignore properties that doesn't exist in Binding?
-
I'm binding some properties to
Loader.item.Loader { id: loader sourceComponent: comp Binding { target: loader.item property: "prop" value: 1 when: loader.status === Loader.Ready } }If
loader.itemdoesn't hasprop, then theBindingshould do nothing, otherwise, pass the value toloader.item. Note that you can't do likeBinding { ... when: loader.status === Loader.Ready && loader.item.prop !== undefined }Because you can't assume that the value of
loader.item.propis not undefined.