21 Mart 2018 Çarşamba

QML Mouse Area Examples 3

  Text {
        id: title
        text: qsTr("Qt Quick ")
        x: 50
        y: 25
        font.family: "Helvetica"
        font.pixelSize: 50
        MouseArea {
            anchors.fill: parent
            onPressed: parent.color = "green"
            onReleased: parent.color = "red"
        }
    }
    Rectangle {
        x: 50
        y: 200
        width: 100
        height: 50
        color: mouse_area.containsMouse ? "blue" : "orange"
        MouseArea {
            id: mouse_area
            anchors.fill: parent
            hoverEnabled: true
        }
    }
Share: