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 Updated to NodeBB v4.3 + New Features

[SOLVED]minus an integer when time is running

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 2 Posters 2.4k Views 1 Watching
  • 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 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 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 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 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 last edited by
            #5

            Thanks ill try this code

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mlong
              wrote on 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

              • Login

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