diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..75c107b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pro.user diff --git a/DasSchmalter.pro b/DasSchmalter.pro index a517b75..e6c81cb 100644 --- a/DasSchmalter.pro +++ b/DasSchmalter.pro @@ -15,7 +15,8 @@ DEFINES += QT_DEPRECATED_WARNINGS SOURCES += \ main.cpp -RESOURCES += qml.qrc +RESOURCES += qml.qrc \ + shared.qrc # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = diff --git a/Qt-Code/DasSchmalter/.gitignore b/Qt-Code/DasSchmalter/.gitignore deleted file mode 100644 index fab7372..0000000 --- a/Qt-Code/DasSchmalter/.gitignore +++ /dev/null @@ -1,73 +0,0 @@ -# This file is used to ignore files which are generated -# ---------------------------------------------------------------------------- - -*~ -*.autosave -*.a -*.core -*.moc -*.o -*.obj -*.orig -*.rej -*.so -*.so.* -*_pch.h.cpp -*_resource.rc -*.qm -.#* -*.*# -core -!core/ -tags -.DS_Store -.directory -*.debug -Makefile* -*.prl -*.app -moc_*.cpp -ui_*.h -qrc_*.cpp -Thumbs.db -*.res -*.rc -/.qmake.cache -/.qmake.stash - -# qtcreator generated files -*.pro.user* - -# xemacs temporary files -*.flc - -# Vim temporary files -.*.swp - -# Visual Studio generated files -*.ib_pdb_index -*.idb -*.ilk -*.pdb -*.sln -*.suo -*.vcproj -*vcproj.*.*.user -*.ncb -*.sdf -*.opensdf -*.vcxproj -*vcxproj.* - -# MinGW generated files -*.Debug -*.Release - -# Python byte code -*.pyc - -# Binaries -# -------- -*.dll -*.exe - diff --git a/main.qml b/main.qml index dc7f56a..5c8806d 100644 --- a/main.qml +++ b/main.qml @@ -6,24 +6,94 @@ Window { visible: true width: 640 height: 480 - title: qsTr("Hello World") + title: qsTr("Das Schmalter") Page { id: app + state: "off" anchors.fill: parent + Button { id: onOffBt + + width: 400 + height: width anchors.centerIn: parent - height: parent.height * 0.5 - width: height - - text: "on/off" - - background: Rectangle { - color: onOffBt.pressed ? "lightgrey":"grey" - radius: height / 2 + 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" + } + ] } } diff --git a/off.png b/off.png new file mode 100644 index 0000000..1716a72 Binary files /dev/null and b/off.png differ diff --git a/on.png b/on.png new file mode 100644 index 0000000..6380424 Binary files /dev/null and b/on.png differ diff --git a/on0.png b/on0.png new file mode 100644 index 0000000..ecbb96c Binary files /dev/null and b/on0.png differ diff --git a/on1.png b/on1.png new file mode 100644 index 0000000..5e74cc6 Binary files /dev/null and b/on1.png differ diff --git a/on2.png b/on2.png new file mode 100644 index 0000000..f4dc401 Binary files /dev/null and b/on2.png differ diff --git a/on3.png b/on3.png new file mode 100644 index 0000000..4e13eba Binary files /dev/null and b/on3.png differ diff --git a/on4.png b/on4.png new file mode 100644 index 0000000..ba1e010 Binary files /dev/null and b/on4.png differ diff --git a/on5.png b/on5.png new file mode 100644 index 0000000..1341a0e Binary files /dev/null and b/on5.png differ diff --git a/shared.qrc b/shared.qrc new file mode 100644 index 0000000..b164dec --- /dev/null +++ b/shared.qrc @@ -0,0 +1,12 @@ + + + off.png + on.png + on5.png + on4.png + on3.png + on2.png + on1.png + on0.png + +