Solved StackView index (count of items)
-
Hello,
I have this simple code:
Window { visible: true width: 640;height: 480 StackView { id:stack anchors.fill: parent initialItem:Rectangle{ anchors.fill: parent color:"red" MouseArea{ anchors.fill: parent onClicked: { console.log(stack.index) } } } } }
But when I clicked on the rectangle, console output is :
qml: undefinedhow can I obtain count of items, or current index from StackView??
Thank you
-
@poucz
StackView
do not have anindex
property, perhaps you meandepth
? -
@poucz
StackView
do not have anindex
property, perhaps you meandepth
? -
Thank you! Depth is what I want.
Can you please explain to me what is StackView.index - it is in the documentation?
What is it for and how is it used?
Thanks!!
-
@poucz said in StackView index (count of items):
What is it for and how is it used?
StackView.index
is an attached property, but it is only available in Quick.Controls 2.x, not Quick.Controls 1.x!initialItem:Rectangle{ anchors.fill: parent color:"red" MouseArea{ anchors.fill: parent onClicked: { console.log(StackView.index) } } }
==> see doc