11-15-2012 02:40 PM
Hello everyone ![]()
I'm brandnew in this Cascades stuff and lot is different than in QtQuick on Symbian, that's why I have one, well two small questions:
1) How can I handle touch events. For example I want to design an element in form of a button, but without using the predefined one. Basically it is a container with color and a label in it. And I want to give a basic animation, so I'm looking for two methods equal to onPressed and onReleased, to change the background color, when the user presses on the button, and to return it to the default color, when he releases it.
2) Is there any kind of Qt Assistant for Cascades? I could only find the online help/API reference here, but it is so messed up in my opinion and functions like searching are missing. In the best case this documentation is downloadable and usable fully offline.
I hope, you can help me... ![]()
Best Regards,
Sebastian
Solved! Go to Solution.
11-15-2012 04:20 PM
11-16-2012 08:05 AM
Tried that as well, but the result is, that the button changes the color when I release the button only. How to do get, that the button was pressed OR released? This is the part I don't understand...
11-16-2012 08:46 AM
I worked on a similar issue today. You can query the type of the touch event like this:
onTouch: {
if (event.touchType == TouchType.Down) {
//doStuff
}
}
I used this to make a whole container to a button, regardless of its content.
11-16-2012 11:17 AM
11-16-2012 12:18 PM
I have found it best to create the custom components then tie a gestureHandlers to it, to mimic a single "onTouch" you would use the "onTapped" gesture. However not sure if you can have an isUp or isDown event on that gesture so i dont know if you'll be able to have the button look like it is "being pressed".
02-11-2013 02:03 AM
Hello,
I have exactly the same problem as your problem #1.
i.e.,
1) How can I handle touch events. For example I want to design an element in form of a button, but without using the predefined one. Basically it is a container with color and a label in it. And I want to give a basic animation, so I'm looking for two methods equal to onPressed and onReleased, to change the background color, when the user presses on the button, and to return it to the default color, when he releases it.
Could you please tell me how/if you solved it???
Thanks.
02-11-2013 03:13 AM