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]


  • Moderators

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



  • 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?


  • Moderators

    I believe that you'd need a "GestureArea":http://qt-project.org/doc/qt-4.8/qml-gesturearea.html in your QML, not a MouseArea. But the two can coexist with each other. Then just handle the onSwipe: call.



  • [quote author="mlong" date="1334700658"]I believe that you'd need a "GestureArea":http://qt-project.org/doc/qt-4.8/qml-gesturearea.html in your QML, not a MouseArea. But the two can coexist with each other. Then just handle the onSwipe: call.
    [/quote]

    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?


  • Moderators

    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.



  • [quote author="mlong" date="1334703342"]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.
    [/quote]

    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?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.