Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML Multitouch on Ubuntu 16.04 not working?

QML Multitouch on Ubuntu 16.04 not working?

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 859 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Axorn
    wrote on last edited by Axorn
    #1

    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: {
                        console.log("pinched!")
                        test.color = "red"
                        flick.interactive = false
                        initialWidth = flick.contentWidth
                        initialHeight = flick.contentHeight
                    }
    
                    onPinchUpdated: {
                        console.log("pinched2!")
                        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: {
                        console.log("pinched3!")
                        // Move its content within bounds.
                        flick.returnToBounds()
                        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: {
                                    console.log("teeest")
                                    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.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Axorn
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved