Example.qml 930 Bytes
Newer Older
Michael Winkelmann's avatar
Michael Winkelmann committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
import QtQuick 2.11
import QtQuick.Window 2.11

import QtQuick.Controls 2.4

Window {
    id: root
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    Rectangle {
        color: "black"
        anchors.fill: parent

        Image {
            opacity: 1.0 - slider.value
            anchors.centerIn: parent
            source: "../car@2x.ktx"
            width: sourceSize.width * 2
            height: sourceSize.height * 2
        }

        Image {
            opacity: slider.value
            anchors.centerIn: parent
            source: "../car@2x.png"
            width: sourceSize.width * 2
            height: sourceSize.height * 2
        }

        Slider {
            id: slider
            from: 0.0
            to: 1.0
            anchors.left: parent.left
            anchors.right: parent.right
            anchors.bottom: parent.bottom
            height: 30
        }
    }
}