April 17, 2012

ShiKaZ ShiKaZ
Lab Rat
7 posts

How to use Swipe Event in MouseArea?

 

Hi! the title describ all my problem
I would like to use the Swype Event in my MouseArea…in the specific my idea consists into use the QSwypeGesture class from Qt but i don’t understand how to implement it in my QML file…
So if someone could help me…
thanks!

[Edit: Edited title; mlong]

6 replies

April 17, 2012

mlong mlong
Mad Scientist
1517 posts

Do you mean QSwipeGesture? Swype is a keyboard entry method.

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

April 18, 2012

ShiKaZ ShiKaZ
Lab Rat
7 posts

yes sorry for the wrong “y”
i want to you this event http://doc.qt.nokia.com/4.7-snapshot/qswipegesture.html in a MouseArea.
How can i implement this event in the QML file?

April 18, 2012

mlong mlong
Mad Scientist
1517 posts

I believe that you’d need a GestureArea [qt-project.org] in your QML, not a MouseArea. But the two can coexist with each other. Then just handle the onSwipe: call.

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

April 18, 2012

ShiKaZ ShiKaZ
Lab Rat
7 posts
mlong wrote:
I believe that you’d need a GestureArea [qt-project.org] in your QML, not a MouseArea. But the two can coexist with each other. Then just handle the onSwipe: call.

you are my savior!
but what if i wanted to included exactly the QSwipeGesture in the application? maybe i might create a .cpp file with a QObject that implemented a signal with the QSWipeGesture class?

April 18, 2012

mlong mlong
Mad Scientist
1517 posts

I’m not sure exactly what you’re asking. You don’t need to instantiate a QSwipeGesture. The GestureArea QML component will handle that for you. Once you respond to it onSwipe, you can do anything you’d like, either in QML or C++ via the normal ways.

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

April 18, 2012

ShiKaZ ShiKaZ
Lab Rat
7 posts
mlong wrote:
I’m not sure exactly what you’re asking. You don’t need to instantiate a QSwipeGesture. The GestureArea QML component will handle that for you. Once you respond to it onSwipe, you can do anything you’d like, either in QML or C++ via the normal ways.

my question more sintetically is:
there is a way (also if i don’t need it now because of GestureArea QML) to use the classe QSwipeGesture?

 
  ‹‹ Reg: Automatic Patching Failed      [SOLVED] XmlListModel not reading from query ››

You must log in to post a reply. Not a member yet? Register here!