mathtrainingstuff/main.qml
2018-11-22 12:39:09 +01:00

100 lines
2.2 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: "idle"
states: [
State {
name: "idle"
PropertyChanges {
target: mainStack
currPage: startPageComp
}
},
State {
name: "calender"
PropertyChanges {
target: mainStack
currPage: calPageComp
}
},
State {
name: "calculate"
PropertyChanges {
target: mainStack
currPage: calcuPageComp
}
}
]
StackView {
id: mainStack
property var currPage
anchors.fill: parent
onCurrPageChanged: {
mainStack.replace(currPage)
}
onCurrentItemChanged: {
mainStack.currentItem.pageOpened()
}
Component {
id: startPageComp
StartPage {
id: startPage
}
}
Component {
id: calPageComp
CalenderPage {
id: calPage
}
}
Component {
id: calcuPageComp
CalculatePage {
id: calcuPage
}
}
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
}
}
}
}
}