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.
qcookieclicker/main.qml
2019-02-01 15:10:30 +01:00

57 lines
1 KiB
QML

import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 2.4
Window {
visible: true
width: 640
height: 480
title: "QcookieClicker"
Page {
id: app
property int level: 0
anchors.fill: parent
Label {
id: levelLa
anchors {
top: parent.top
horizontalCenter: parent.horizontalCenter
topMargin: 20
}
font.pixelSize: 30
text: app.level
}
Button {
id: cookieBt
anchors.centerIn: parent
height: parent.height * 0.3
width: height
scale: pressed ? 0.8:1
background: Image {
source: "qrc:/icons/cookie.png"
}
onClicked: {
app.level = app.level + 1
}
Behavior on scale {
NumberAnimation {
duration: 100
}
}
}
}
}