How can I save a ListModel in Qt Quick ?



  • Hi
    I'm new with Qt Creator and I just started a simple qt quick project to learn about it. My question is : Can I save a ListModel and then load it each time I execute my application ?

    Thanks.



  • Welcome to forum. You need to extend QAbstractitemModel in C++ and expose it QML. Extended class need to have save method to save contents to file or any local storage. When you are start QML app, read from the data from storage and build your model and expose it. Look at examples given in your installation under examples directory (\examples\quick\models)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.