List View: Reference Error: index is not defined.
-
Hi, I have list view which contains 'n' no of items.
When i click on the item, then "Reference Error: index is not defined." is shown and list view start scrolling and stop at anywhere.
This happens when i click on item not for all item.I want, when i click on item then list view doesn't start scrolling.
Please suggest -
Please show your sample code.
-
@dheerendra
ListView{
id:program_lv
width:1280
height:577
model::Helper.all_programs_model
delegate:refresh_del?null: program_del
currentIndex: -1
clip:true
boundsBehavior: Flickable.StopAtBounds
anchors{
horizontalCenter: parent.horizontalCenter
top:parent.top
topMargin: parent.height0.1925//154
}
ScrollBar.vertical:ScrollBar {
id: control
width:parent.width0.020
opacity: 0.85
active: true
orientation: Qt.Vertical
visible: program_lv.contentHeight>program_lv.height
anchors{right:parent.right;rightMargin:0}
background:Rectangle{
radius:width/4
color: "lightgrey"
}
contentItem: Rectangle {
implicitWidth:1
implicitHeight: parent.height*0.189
radius: width / 2
opacity:0.85
color: "grey"
}
}
}Component{ id:program_del ProgramListComponents.ProgramListDelegate{ width:program_lv.width//1280 height: product_id!=-1?program_lv.height*0.166:0//96 visible: product_id!=-1 } }
-
Atleast I did not see something glaring mistake in your program. It is telling you that index is not defined. Are you using the index variable somewhere ? I did not see any index variable usage in your program. My suspect was that you are doing something inside the delegate using index variable. This may be causing the issue. However your code does not reflect that.
-
ok thanx
-
Was it as issue in your code ?