1
qml의 중첩 된 목록 뷰가있는 listview가 있습니다. 중첩 된 listview 대리인의 부모 목록 뷰 색인 색인을 어떻게 얻을 수 있습니까?qt 중첩 목록보기에서 listview의 빠른 호출 색인
코드 샘플 :이 그림자되지 않도록
ListView {
id: listView
anchors.fill: parent
delegate: delegate
model: myModel
}
Component {
id: delegate
Item {
id: recipe
width: listView.width
height: 120
Column {
// some text fields
ListView {
id: listView1
width: listView.width
height: 50
delegate: nextLevelDelegate
model: nextLevelList
}
}
}
}
Component {
id: nextLevelDelegate
Item{
width: listView1.width
height: 20
Rectangle {
id: background2
x: 2; y: 2; width: parent.width - x*2; height: parent.height - y*2
color: "lightgray"
border.color: "gray"
radius: 5
}
Text {
anchors.fill: parent
id:nextLevelButton
horizontalAlignment:Text.AlignHCenter
text: modelData
}
MouseArea
{
anchors.fill: parent
id: mouseArea
onClicked: {
window.buttonPressed(nextLevelButton.text,listView.currentIndex);//I need parent index here for calling c++ method with it
}
}
}
}
정말 고마워요. – aknew