This commit is contained in:
Max 2018-11-22 13:13:46 +01:00
parent 82192b9c7d
commit 71b1fa5c36
1 changed files with 12 additions and 3 deletions

View File

@ -7,6 +7,8 @@ Page {
property var nums: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
property int currIndex: -1
property int tickInterval: 1000
property int numCount: 10
signal pageOpened()
@ -56,6 +58,7 @@ Page {
anchors {
top: parent.top
topMargin: parent.height * 0.05
horizontalCenter: parent.horizontalCenter
}
font.pixelSize: parent.height * 0.15
text: "Calculator"
@ -65,7 +68,7 @@ Page {
from: 1
to: 100000
stepSize: 1
value: 30
value: 1000
anchors.horizontalCenter: parent.horizontalCenter
editable: true
anchors {
@ -74,6 +77,9 @@ Page {
leftMargin: parent.width * 0.5 - width * 0.5
topMargin: parent.height * 0.3 - height * 0.5
}
onValueChanged: {
calculator.tickInterval = calculatorTickInterval.value
}
}
SpinBox {
@ -90,6 +96,9 @@ Page {
leftMargin: parent.width * 0.5 - width * 0.5
topMargin: parent.height * 0.6 - height * 0.5
}
onValueChanged: {
calculator.numCount = calculatorNumCount.value
}
}
Button {
id: calculatorStartButton
@ -141,12 +150,12 @@ Page {
Timer {
id: tick
interval: calculatorTickInterval.value
interval: calculator.tickInterval
repeat: false
running: calculator.state === "running"
onTriggered: {
if(calculator.currIndex+1 <= 9){
if(calculator.currIndex+1 <= calculator.numCount-1){
nextNumber()
tick.start()
}