Comment 5 for bug 1296832

Revision history for this message
Zsombor Egri (zsombi) wrote :

import QtQuick 2.0

Item {
    width: 100
    height: 62

    PinchArea {
        id: pinchArea
        anchors.fill: parent

        pinch.minimumScale: 0.5
        pinch.maximumScale: 2.0
        pinch.target: img
        pinch.dragAxis: Pinch.NoDrag

        onPinchStarted: {
            console.log("STARTED", pinch.scale, pinch.rotation, pinch.pointCount)
        }

        onPinchUpdated: {
            console.log("UPDATED", pinch.scale, pinch.rotation, pinch.pointCount)
        }

        onPinchFinished: {
            console.log("FINISHED", pinch.scale, pinch.rotation, pinch.pointCount)
        }

        MouseArea {
            id: m
            anchors.fill: parent
            onPressed: {
                mouse.accepted = false
                console.log("PRESSED")
            }
            onClicked: console.log("CLICKED")
        }
    }

    MouseArea {
        anchors.fill: parent
        onPressed: {
            mouse.accepted = false
            console.log("OUTER PRESSED")
        }
    }

    Rectangle {
        id: img
        width: parent.width / 2
        height: parent.height / 2
        anchors.centerIn: parent
        color: "green"
    }
}