QML Multitouch on Ubuntu 16.04 not working?

  • I would like to use the PinchArea on Ubuntu 16.04 and it doesn't seem to work. What I did so far:

    • Tried PinchArea and Multitouch example from Qt, both not working on Ubuntu 16.04 (Qt 5.6, gcc5.4)
    • Same applications work on Windows 7 (Qt5.6, mingw)
    • Pinch zoom works on Ubuntu 16.04 for image viewer
    • Geisview shows gesture events when I am touching in the qml application, however no pinch event arises in qml
    • Flickable from qml does work (single touch)
    • tried different touch screens from different manufacturers, all do not trigger the pinch/multitouch event
    • installed recommended driver from manufacturer, but no effect

    Here is the example PinchArea code from Qt, which I am using:

    import QtQuick 2.6
    import QtQuick.Window 2.2
    Window {
        visible: true
        width: 640
        height: 360
        title: qsTr("Hello World")
        Rectangle {
            id: test
            width: 640
            height: 360
            color: "gray"
            Flickable {
                id: flick
                anchors.fill: parent
                contentWidth: 500
                contentHeight: 500
                PinchArea {
                    width: Math.max(flick.contentWidth, flick.width)
                    height: Math.max(flick.contentHeight, flick.height)
                    property real initialWidth
                    property real initialHeight
                    onPinchStarted: {
                        test.color = "red"
                        flick.interactive = false
                        initialWidth = flick.contentWidth
                        initialHeight = flick.contentHeight
                    onPinchUpdated: {
                        test.color = "red"
                        // adjust content pos due to drag
                        flick.contentX += pinch.previousCenter.x - pinch.center.x
                        flick.contentY += pinch.previousCenter.y - pinch.center.y
                        // resize content
                        flick.resizeContent(initialWidth * pinch.scale, initialHeight * pinch.scale, pinch.center)
                    onPinchFinished: {
                        // Move its content within bounds.
                        flick.interactive = true
                        test.color = "red"
                    Rectangle {
                        width: flick.contentWidth
                        height: flick.contentHeight
                        color: "white"
                        Image {
                            anchors.fill: parent
                            source: "image.png"
                            MouseArea {
                                anchors.fill: parent
                                onDoubleClicked: {
                                    test.color = "red"
                                    flick.contentWidth = 500
                                    flick.contentHeight = 500

    Am I missing something or do you have any ideas how to fix this issue? Any help would be highly appreciated.

  • Works with pre-built Qt version. Has to be build parameter dependant.

Log in to reply

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