Files
sonobulus/ui/Main.qml

53 lines
1.0 KiB
QML

import QtQuick
import QtQuick.Controls
import AppDemo
ApplicationWindow {
visible: true
width: 600
height: 400
title: "sonobulus"
TimerComponent {
id: timerComponent
}
Column {
anchors.centerIn: parent
spacing: 20
Label {
text: timerComponent.seconds + " s"
font.pixelSize: 32
horizontalAlignment: Text.AlignHCenter
}
Button {
text: "Reset"
onClicked: timerComponent.reset()
}
}
Item {
anchors.fill: parent
focus: true
Keys.onPressed: (event) => {
if(!event.isAutoRepeat) {
keyboardController.keyDownEvent(event.key, event.modifiers, event.text)
event.accepted = true
}
}
Keys.onReleased: (event) => {
if(!event.isAutoRepeat) {
keyboardController.keyUpEvent(event.key, event.modifiers, event.text)
event.accepted = true
}
}
}
}