From 71b1fa5c36b355ca5f0112b2d63505a86f5d487e Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 22 Nov 2018 13:13:46 +0100 Subject: [PATCH] BugFixes --- CalculatePage.qml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/CalculatePage.qml b/CalculatePage.qml index 0fa1ace..6b126cb 100644 --- a/CalculatePage.qml +++ b/CalculatePage.qml @@ -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() }