How to change the visible property of the dynamically created item to bind with SwipeView.isCurrentItem?
Unsolved
QML and Qt Quick
-
Hi,
I am trying to insert some particular page to SwipeView based on the type of OS that the target machine is running. (Win or Unix)
The dynamical creation and the insertion of the QML page was not a issue, but changing the visible property is.
I need to hide the page when it is not the current item. It used to be done with this
SomeQmlComponent { visible: SwipeView.isCurrentItem ? true : false }
But the same would not work on the pages that are created dynamically.
This is what I have now:
Component.onCompleted: { if (SystemSetting.isRunningEmbedded) { ComponentCreation.createComponent("pathToQml", swipeView, 1) } for (var i = 0; i < swipeView.count; i++) { var child = swipeView.itemAt(i) child.visible = // what should I do here? } }
Thanks in advance