我有一个带有按钮的列表视图,但无法触发 qml blackberry 10 中按钮的单击事件?任何人都可以帮我解决这个问题,
ListView {
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
layout: FlowListLayout {
}
dataModel: mydatamodel
listItemComponents: [
ListItemComponent {
type: "item"
Container {
layout: DockLayout {
}
Button {
id: samplebutton
text: "Button"
horizontalAlignment: HorizontalAlignment.Right
onClicked: {
//click event not fired here..
}
}
Label {
horizontalAlignment: HorizontalAlignment.Left
text: "Sample Label"
}
Divider {
horizontalAlignment: HorizontalAlignment.Fill
}
}
}
]
onTriggered: {
var selectedItem = dataModel.data(indexPath);
}
}