Why does QtQuick does not have TouchArea (like MouseArea) ?
-
No, only desktop and Android. Which in a way is an embedded linux device, but I'm sure that is not what you mean :)
-
Can you show me a code sample of touch (mouse) interaction you have in QML ?
-
Here is a whole, big project I'm working on: "LINK":https://gitorious.org/closecombatfree/closecombatfree/blobs/master/qml/scenarios/Scenario.qml.
And some relevant pieces of code:
@
Flickable {
id: gameArea
height: someHeight
contentWidth: map.width
contentHeight: map.height
boundsBehavior: Flickable.StopAtBounds
clip: trueanchors.top: root.top anchors.left: root.left anchors.right: root.right PinchArea { id: pinchArea anchors.fill: parent onPinchUpdated: { zoom += pinch.scale - pinch.previousScale; } }
}
@Flickable element makes it possible to swype (move the map around), PinchArea is used for zooming. Tapping and long tapping is handled by MouseArea, just like on desktop. In case of my app, the code is quite complicated at that stage, but in principle, it's just as easy on desktop, as on mobile devices.
-
Thanks.
Did you try List dragging and buttons ? -
Yes. I use GridView for that, it inherits Flickable, so that solves dragging problem. As items for it, I use just rectangles with MouseAreas inside them (one MouseArea per every button).
There were some bugs there, now I think about it, but I think it had more to do with my (at that time) sloppy coding.
-
On what HW did you test it (CPU's, RAM, clock speed, openGL) ?
-
Samsung Galaxy S2 (dualcore ARM 1.2GHz, 1GB RAM), both on Android 2.3 and 4.0.4 (CyanogenMod). I don't remember if OpenGL support was available at that time (half a year ago).
Currently I have ported my project to Qt5, which is not yet available on droid, so I don't have up-to-date news.
-
Does QT 5 improved your QML apps performance ?
-
Performance was good anyway, so I've seen no dramatic improvement because there was nothing to improve on ;) I did not run any benchmarks, though.
Nokia did some tests 1,5 years ago and it was, IIRC, about 200% faster. A lot has been done since then, so it might be even faster now (or not).
I did the move because I wanted to test some new features early (new particle system, 'var' properties, V8 engine, etc.). The project I am working on is an after-work hobby anyway, so I can do that easily :)
-
Was the touch performance were better with pen (stylus) than with finger touch ?
-
I've used my fingers only, no stylus.
-
Thanks !
-
Cheers. Hope it helped.