Reputation: 521
I am trying to figure out how to respond to the tapping on a textfield in Blackberry Cascades. Right now, I have this sort of code:
TextField {
onFocusedChanged: {
if (focused) {
doStuff();
}
}
}
But this responds the moment you click on an item, but doesn't wait till you let go of the mouse in the simulator (or the equivalent in a real blackberry)
Upvotes: 1
Views: 2470
Reputation: 2742
Try this code, this worked for me in Simulator. I don't have a blackberry device to check this.
TextField {
id: field
width: parent.width
MouseArea {
anchors.fill: parent
onClicked:{ console.debug("Got click event received! \nSetting focus for TextField"); field.focus = true; }
}
}
Upvotes: 2