made one stateMachine in calculator

This commit is contained in:
Max 2018-11-30 20:58:24 +01:00
parent 5e5d8f954a
commit 534832f546
4 changed files with 10 additions and 6 deletions

View file

@ -42,7 +42,7 @@ Item {
name: "ending" name: "ending"
PropertyChanges { PropertyChanges {
target: calculatorStack target: calculatorStack
currPage: calculatorEndPageComp currPage: calculatorGameOverPageComp
} }
} }
] ]
@ -74,9 +74,8 @@ Item {
} }
Component { Component {
id: calculatorEndPageComp id: calculatorGameOverPageComp
CalculatorEndPage { CalculatorGameOverPage {
id: calculatorEndPage
} }
} }
@ -142,4 +141,10 @@ Item {
calculator.endPageVisibility = true calculator.endPageVisibility = true
} }
} }
function setState(state) {
if (state === "starting") {
}
calculator.state = state
}
} }

View file

@ -36,7 +36,6 @@ Window {
PropertyChanges { PropertyChanges {
target: mainStack target: mainStack
currPage: calculatorPageComp currPage: calculatorPageComp
} }
} }
] ]

View file

@ -5,7 +5,7 @@
<file>StartPage.qml</file> <file>StartPage.qml</file>
<file>CalculatorMainPage.qml</file> <file>CalculatorMainPage.qml</file>
<file>CalculatorStartPage.qml</file> <file>CalculatorStartPage.qml</file>
<file>CalculatorEndPage.qml</file> <file>CalculatorGameOverPage.qml</file>
<file>Calculator.qml</file> <file>Calculator.qml</file>
</qresource> </qresource>
</RCC> </RCC>