Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [SOLVED]minus an integer when time is running
Forum Update on Monday, May 27th 2025

[SOLVED]minus an integer when time is running

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 2 Posters 2.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jr_jags
    wrote on 1 Aug 2011, 16:15 last edited by
    #1

    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?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mlong
      wrote on 1 Aug 2011, 16:28 last edited by
      #2

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

      Software Engineer
      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jr_jags
        wrote on 1 Aug 2011, 16:43 last edited by
        #3

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

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mlong
          wrote on 1 Aug 2011, 16:46 last edited by
          #4

          Something like:

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

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

          Software Engineer
          My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jr_jags
            wrote on 1 Aug 2011, 17:16 last edited by
            #5

            Thanks ill try this code

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mlong
              wrote on 1 Aug 2011, 17:49 last edited by
              #6

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

              Software Engineer
              My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

              1 Reply Last reply
              0

              1/6

              1 Aug 2011, 16:15

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved