Reputation: 521
I asked this question before in other wording, but maybe the question was poorly worded, and no one seemed to answer. I have been searching for a working example showing an answer to my question, but I cannot find any. I really need to know the answer to this.
In Blackberry Cascades, QML, QT & C++, how do I respond to someone tapping on an item in a list?
Is the answer to do with involving TapHandler and ListView? If so, could someone please show me how to connect the two, because I cannot find any examples of that on the internet.
Upvotes: 0
Views: 1654
Reputation: 1532
Here's a boiler plate example, similar to code I use in my Cascades apps:
ListView {
dataModel: XmlDataModel {
source: "data/items.xml"
function doResponse(){}
}
listItemComponents: [
ListItemComponent {
type: "item"
StandardListItem {
id: listItem
title: ListItemData.title
onTouch: {
if (event.isUp()){
listItem.ListItem.view.dataModel.doResponse();
}
}
}
}
]
}
Upvotes: 3