[SOLVED]minus an integer when time is running
-
wrote on 1 Aug 2011, 16:15 last edited by
i want to implement on my application, when time is running the integer previewed in my QML is decreasing, for example for every 5 mins the number that is previewed is decreased by 5,
How can i do this?And another question, the previewed number is stored in a js file offline storage, can i decreased the numbers saved in the storage?
-
wrote on 1 Aug 2011, 16:28 last edited by
Every 5 minutes, a Timer fires, you fetch the number in offline storage, decrement it, then resave it. Or something like that?
-
wrote on 1 Aug 2011, 16:43 last edited by
ahhh, can the timer minus function be executed automatically? or triggered? i nid this to be automatically,
Is that possible? -
wrote on 1 Aug 2011, 16:46 last edited by
Something like:
@
Timer {
id: decrementTimer
interval: 5 * 60000 // 5 minutes
repeat: true
running: trueonTriggered: {
// do your decrement code here
}
}
@ -
wrote on 1 Aug 2011, 17:16 last edited by
Thanks ill try this code
-
wrote on 1 Aug 2011, 17:49 last edited by
Ok. Hope it works! If it does, be sure to mark the thread as Solved.
1/6