[SOLVED]minus an integer when time is running



  • 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?


  • Moderators

    Every 5 minutes, a Timer fires, you fetch the number in offline storage, decrement it, then resave it. Or something like that?



  • ahhh, can the timer minus function be executed automatically? or triggered? i nid this to be automatically,
    Is that possible?


  • Moderators

    Something like:

    @
    Timer {
    id: decrementTimer
    interval: 5 * 60000 // 5 minutes
    repeat: true
    running: true

    onTriggered: {
    // do your decrement code here
    }
    }
    @



  • Thanks ill try this code


  • Moderators

    Ok. Hope it works! If it does, be sure to mark the thread as Solved.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.