mathtrainingstuff/main.qml
2018-11-26 19:33:59 +01:00

98 lines
2.1 KiB
QML

import QtQuick 2.9
import QtQuick.Window 2.3
import QtQuick.Controls 2.4
import "./"
Window {
visible: true
width: 640
height: 480
title: qsTr("Training")
Item {
id: game
anchors.fill: parent
state: "starting"
states: [
State {
name: "starting"
PropertyChanges {
target: mainStack
currPage: startPageComp
}
},
State {
name: "calender"
PropertyChanges {
target: mainStack
currPage: calenderPageComp
}
},
State {
name: "calculator"
PropertyChanges {
target: mainStack
currPage: calculatorPageComp
}
}
]
StackView {
id: mainStack
property var currPage
anchors.fill: parent
onCurrPageChanged: {
mainStack.replace(currPage)
}
onCurrentItemChanged: {
mainStack.currentItem.pageOpened()
}
Component {
id: startPageComp
StartPage {
}
}
Component {
id: calenderPageComp
CalenderPage {
}
}
Component {
id: calculatorPageComp
Calculator {
}
}
replaceExit: Transition {
NumberAnimation {
from: 1
to: 0
property: "opacity"
duration: 200
easing.type: Easing.InOutQuad
}
}
replaceEnter: Transition {
NumberAnimation {
from: 0
to: 1
property: "opacity"
duration: 200
easing.type: Easing.InOutQuad
}
}
}
}
}