Create a multitouch application



  • I'm trying to write a multitouch desktop application. I have a QML based application and now I try to drag more than one QML element at the same time. I tried to use MultiPointTouchArea, but this doesen't work. So I got 2 elements. For example 2 pictures, which should be draggable by two different persons at the same time ...
    If I define a rectangle containing the MultiPointTouchArea and I link one touchPoint with each picture, the first touch event moves the first picture and the second touch event moves the second picture.

    Like in this example code:

    @Rectangle {
    width: 400; height: 400
    MultiPointTouchArea {
    anchors.fill: parent
    touchPoints: [
    TouchPoint { id: point1 },
    TouchPoint { id: point2 }
    ]
    }

        Rectangle {
            width: 30; height: 30
            color: "green"
            x: point1.x
            y: point1.y
        }
    
        Rectangle {
            width: 30; height: 30
            color: "yellow"
            x: point2.x
            y: point2.y
        }
    }@
    

    This is not, what I'm looking for. I want them to move, if they are touched and dragged, both at the same time, without disturbing each other and without a order of touch events.

    Is this possible in qml? Or do I have to code a C++ function?

    I hope you understand my problem.



  • I m facing the same issue, i can not make two zoom event at the same time by using MultiPointTouchArea , if anyone can share some sample code for two hand/two person multitouch control in qml it will be much appreciated.


Log in to reply
 

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