01-05-2013 01:57 PM
When I make a count function to get how many times a picture is touched.
But when i touch picture just 1 time, but the function show 2.
I don't know what is going on. Please help.
Thanks.
Solved! Go to Solution.
01-05-2013 02:09 PM
01-05-2013 02:13 PM
ImageView {
id: image01
imageSource: "asset:///images/01.jpg"
onTouch: {
nav.count = nav.count + 1;
}
}
01-05-2013 02:18 PM
Probably you receive events for touch down and touch up. Try:
if (event.touchType == TouchType.Up)
{
// increment the counter
}
01-05-2013 02:28 PM
Where I can apply this code, in QML or Qt, I have tried on QML but there is no Touch Up or Down?
01-05-2013 02:34 PM - edited 01-05-2013 02:39 PM
Can you try this one please? (in QML)
onTouch: {
if (event.isDown()) {
// ...
}
}
Here is a list of all touch events:
https://developer.blackberry.com/cascades/referenc
Q_INVOKABLE functions and slots can be called from QML.