magpie/qml/main.qml

46 lines
804 B
QML
Raw Normal View History

2023-11-22 23:13:33 +00:00
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Layouts
2023-11-24 23:48:01 +00:00
ApplicationWindow {
2023-11-22 23:13:33 +00:00
property int counter: 0
id: window
width: 640
height: 480
visible: true
2023-11-24 23:48:01 +00:00
title: "Megpie"
header: Label {
text: stack.currentItem.title
horizontalAlignment: Text.AlignHCenter
}
2023-11-22 23:13:33 +00:00
2023-11-24 23:48:01 +00:00
StackView {
id: stack
initialItem: welcome
2023-11-22 23:13:33 +00:00
anchors.fill: parent
2023-11-24 23:48:01 +00:00
}
Welcome {
id: welcome
onPickServer: function (address) {
pick.address = address;
stack.push(pick)
2023-11-22 23:13:33 +00:00
}
2023-11-24 23:48:01 +00:00
}
2023-11-22 23:13:33 +00:00
2023-11-24 23:48:01 +00:00
ServerPick {
visible: false
id: pick
onBack: stack.pop()
onSuccess: function (address) {
welcome.serverAddress = address;
stack.pop();
2023-11-22 23:13:33 +00:00
}
}
}