January 8, 2011

bartleby bartleby
Lab Rat
2 posts

QML gestures on N900 / Maemo

 

I’m trying out the (experimental) QML GestureArea on an N900 (Qt 4.7).

E.g.,

  1. GestureArea {
  2.      anchors.fill: parent
  3.      onPan: console.log('pan')
  4.      onPinch: console.log('pinch')
  5.      onSwipe: console.log('swipe')
  6.      onTapAndHold: console.log('tapAndHold')
  7.      onTap: console.log('tap')
  8.      onGesture: console.log('gesture')
  9.  }

I’m able to generate tap and tapandhold events, but nothing else.
With the N900 being resistive, I wouldn’t expect pinch to work, but I’m surprised that I can’t swipe or pan.
Am I missing something, or does this feature just not work yet?

3 replies

January 24, 2011

athamala athamala
Lab Rat
5 posts

All those other gestures require more than one touch point, so they are not available on N900. See related QT bug report.

http://bugreports.qt.nokia.com/browse/QTBUG-15996

January 26, 2011

bartleby bartleby
Lab Rat
2 posts

Thanks for the bug report link.

In the case of swipe, I was misled by this:

http://doc.qt.nokia.com/4.6/qswipegesture.html#details

which is apparently just wrong, and by the fact that my N900 says “Swipe to unlock”.

January 27, 2011

athamala athamala
Lab Rat
5 posts

You might want to make it a Mousearea and check for its signal handlers like onPressed, onPositionChanged and onReleased and get position information from MouseEvent parameters in those handlers. I think that swipe to unlock is made similarly by monitoring mouse events.

http://doc.qt.nokia.com/4.7-snapshot/qml-mousearea.html
http://doc.qt.nokia.com/4.7-snapshot/qml-mouseevent.html

To see mouseevents and dragging in mousearea in use take a look at Mousearea example, that has clickable and draggable boxes.

http://doc.qt.nokia.com/4.7-snapshot/declarative-touchinteraction-mousearea-mousearea-example-qml.html

 
  ‹‹ QT Mobility 1.1 & Camera Access      Unique Machine ID ››

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