Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › How should I store my data?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24172

    Jens

    I am making a simple scheduling app where the user can create activities that have properties such as title, starting time, ending time, etc. What is the recommended way to store the activities that the user has created across app launches? Would ‘Storage’ be the right tool for this? If I have understood things correctly, Storage works kind of like a map, where you store things connected to a key, and then you use the key to access it later. How would I then store objects with several properties in Storage?

    #24180

    Filippo
    Felgo Team

    Hi Jens,

    thank you for reaching out to us. You’re completely right Storage is the best way to store simple data. If you want to persist “complex” objects you can use js objects. The Storage component will take care of transforming it into a string and back to an object.

    var fruit = {id: 1, value: 100, description: "Some text."}
    
    storage.setValue("key", fruit)
    
    var storedFruit = storage.getValue("key")
Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded