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. Adding a number to a saved number in a storage

Adding a number to a saved number in a storage

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 2.1k 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

    This is my storage.set code
    For example i had 5 in my storage and i want to add more by executing this code:

    @ Storage.setSettingCoins("settingCoins", //What should i put in here if i want to add 1 to my saved number?)@

    I triggered this code when i click a mousearea

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Diph
      wrote on last edited by
      #2

      What is this Storage? Is it using QML database API. You'll have to get the value first and sum it with the number. Then set the value.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jr_jags
        wrote on last edited by
        #3

        oh thank you for the idea ^ ^ ill sum the two numbers first

        1 Reply Last reply
        0
        • D Offline
          D Offline
          Diph
          wrote on last edited by
          #4

          Or if you can access the sqlite database you can increment the field:

          @UPDATE table SET number=number+1 WHERE id=123@

          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