Another thing I noticed is that you used a timer in the StopwatchPage.qml,
// Timer to restore original size of the test after a new lap.
Timer {
id: animation_timer
interval: 100
repeat: false onTriggered: { analogStopwatch.innerLabel.font.pixelSize = units.dp(41);
}
}
I am pretty sure that we don't need this timer at all. What you need to do here is use a sequential animation which first increases the text size to units.dp(41) and then decrease it back to units.dp(30). I have added a sample code below to help you.
Another thing I noticed is that you used a timer in the StopwatchPage.qml,
// Timer to restore original size of the test after a new lap.
onTriggered: {
analogStop watch.innerLabe l.font. pixelSize = units.dp(41);
Timer {
id: animation_timer
interval: 100
repeat: false
}
}
I am pretty sure that we don't need this timer at all. What you need to do here is use a sequential animation which first increases the text size to units.dp(41) and then decrease it back to units.dp(30). I have added a sample code below to help you.
Sequential Animation {
UbuntuNumberA nimation { target: innerLabel; property: "font.pixelSize"; to: units.dp(41) }
UbuntuNumberA nimation { target: innerLabel; property: "font.pixelSize"; to: units.dp(30) }
id: fontAnimation
}
And then when you press the lap button, you can start the animation by,
fontAnimat ion.start( )
For more information on sequential animation, please refer to http:// qt-project. org/doc/ qt-4.8/ qml-sequentiala nimation. html