import QtQuick 2.9 import QtQuick.Window 2.2 import QtQuick.Controls 2.4 Window { visible: true width: 640 height: 480 title: qsTr("Das Schmalter") Page { id: app state: "off" anchors.fill: parent Button { id: onOffBt width: 400 height: width anchors.centerIn: parent background: Item { id: lamp Image { id: lampOn source: "on.png" anchors.fill: parent scale: 0 } Image { id: lampOn0 source: "on0.png" anchors.fill: parent scale: 0 } Image { id: lampOn1 source: "on1.png" anchors.fill: parent scale: 0 } Image { id: lampOn2 source: "on2.png" anchors.fill: parent scale: 0 } Image { id: lampOn3 source: "on3.png" anchors.fill: parent scale: 0 } Image { id: lampOn4 source: "on4.png" anchors.fill: parent scale: 0 } Image { id: lampOn5 source: "on4.png" anchors.fill: parent scale: 0 } Image { id: lampOff source: "off.png" anchors.fill: parent scale: 1 } } onClicked: { if (app.state === "on") { app.state = "off" } else { app.state = "on" } } } states: [ State { name: "on" PropertyChanges { target: lampOn scale: 1 } PropertyChanges { target: lampOff scale: 0 } }, State { name: "off" } ] } }