Hi,
i hope you can help me to find out whether i have found a bug or not. I tried to use the index variable in a delegate within a ListView.
ListView {
id: selectedItems
width: childrenRect.width
implicitHeight: currentItem ? currentItem.height : 0
clip: true
orientation: ListView.Horizontal
model: breadCrumbModel
delegate: Component {
id: delegateComp
Row {
visible: ListView.isCurrentItem ? !mover.visible : true
id: wrapper
property var wrapperitemdata: (itemdata ? itemdata : parent.itemdata)
Loader {
sourceComponent: container.separator
anchors.verticalCenter: breadcrumb.verticalCenter
height: breadcrumb.height
visible: (index == 0 ? false : true)
MouseArea {
anchors.fill: parent
onClicked: container.separatorClicked(index)
}
}
Loader {
id: breadcrumb
property var itemdata: wrapper.wrapperitemdata
sourceComponent: container.breadCrumbDelegate
MouseArea{
anchors.fill: parent
onClicked: container.breadCrumbClicked(index)
}
}
}
}
}
This line 130 is relevant:
visible: (index == 0 ? false : true)
The code works good but i will get error to console:
BreadCrumbBar.qml:130: ReferenceError: index is not defined
Did i made something wrong?
↧