Qt World Summit: Register Today!

Adding a number to a saved number in a storage

  • 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

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

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

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

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

Log in to reply