made one stateMachine in calculator
This commit is contained in:
parent
5e5d8f954a
commit
534832f546
4 changed files with 10 additions and 6 deletions
|
@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
1
main.qml
1
main.qml
|
@ -36,7 +36,6 @@ Window {
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: mainStack
|
target: mainStack
|
||||||
currPage: calculatorPageComp
|
currPage: calculatorPageComp
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
2
qml.qrc
2
qml.qrc
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue