This repository has been archived on 2022-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
dasschmalter/main.qml

100 lines
2.4 KiB
QML
Raw Normal View History

2019-02-23 10:33:02 +01:00
import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 2.4
Window {
visible: true
width: 640
height: 480
2019-02-23 14:55:38 +01:00
title: qsTr("Das Schmalter")
2019-02-23 10:33:02 +01:00
Page {
id: app
2019-02-23 14:55:38 +01:00
state: "off"
2019-02-23 10:33:02 +01:00
anchors.fill: parent
2019-02-23 14:55:38 +01:00
2019-02-23 10:33:02 +01:00
Button {
id: onOffBt
2019-02-23 14:55:38 +01:00
width: 400
height: width
anchors.centerIn: parent
2019-02-23 10:33:02 +01:00
2019-02-23 14:55:38 +01:00
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"
}
2019-02-23 10:33:02 +01:00
}
}
2019-02-23 14:55:38 +01:00
states: [
State {
name: "on"
PropertyChanges {
target: lampOn
scale: 1
}
PropertyChanges {
target: lampOff
scale: 0
}
},
State {
name: "off"
}
]
2019-02-23 10:33:02 +01:00
}
}