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. How can I save a ListModel in Qt Quick ?
Forum Updated to NodeBB v4.3 + New Features

How can I save a ListModel in Qt Quick ?

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.5k 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.
  • M Offline
    M Offline
    minhblabla
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      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)

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      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