- Well I am trying to make a list of items having two texts and a checkbox in a listView.
- I wanted to add the price of the item when the checkbox is checked.
- To accomplish this, I need to know the index of the item of a listView so that I could get its "price" and I could store the data.
- I am unable to get the current Index of a list through a checkbox, as it behaves as an individual entity.
- However, I could get the index if I put a mouse area, but I need to grab it by checkbox.
for reference:
Component { // delegate
id:_delegate
Rectangle{
width: 100
height: 50
color: "beige"
border.color: "black"
Text {
id: _textid
text: name
}
Text {
id: _textid2
anchors.top: _textid.bottom;anchors.topMargin: 5
anchors.left: _textid.left
text: price
}
CheckBox {
id:_checkbox
anchors.top:parent.top;anchors.topMargin: 5
anchors.left: parent.left;anchors.leftMargin: 50
}
}