QML gestures on N900 / Maemo
I’m trying out the (experimental) QML GestureArea on an N900 (Qt 4.7).
E.g.,
- GestureArea {
- anchors.fill: parent
- onPan: console.log('pan')
- onPinch: console.log('pinch')
- onSwipe: console.log('swipe')
- onTapAndHold: console.log('tapAndHold')
- onTap: console.log('tap')
- onGesture: console.log('gesture')
- }
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
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”.
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.
You must log in to post a reply. Not a member yet? Register here!
