I have a use case where depending on the presence or absence of a property value an object referencing it is either created or removed. I am using a Loader
for
I came across this yesterday. I need two Loaders which share the same property. In C++ class, I update the two Loader's active property one by one, which will also lead to that problem. My solution for this is using a Binding and do some setting like this:
Binding {
target: contentItemAlias
property: 'currentIndex'
value: if (header.status == Loader.Ready)
header.item.currentIndex //ensure the current status is not null
when: content.status === Loader.Ready // the content is ready
}
Actually maybe this will not help you, but this is the solution in my code. I hope you will see it and have a try at binding
. Wish you success.
here is the link to my project: https://github.com/begoat/qmlLive