我遇到了ListView的问题。ListView太长了,一部分超出了窗口范围,但是我无法添加滚动条。我尝试了许多不同的组合。我认为问题在于高度参数,但如果删除它,ListView只会显示第一个条目。
Column{
anchors.fill: parent
Row{
id: buttonsRow
Button{
text: "Open dump file"
onClicked: fileDialog.visible = true
}
Button{
text: "Copy raw data to clipboard"
}
}
ListView{
id: listView
anchors.top: buttonsRow.bottom
height: contentHeight
//clip: true
flickableDirection: Flickable.VerticalFlick
boundsBehavior: Flickable.StopAtBounds
interactive: true
model: ListModel{
id: listModel
}
delegate: MDelegate{}
}
}
有没有办法使它可滚动?