Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QSettings to save data structure



  • I am in the process of building a .cbz reader application in Qt.

    When the user opens up a .cbz file, it parses through and saves all of the .png/.jpg images inside of a List data structure in my c++ class.

    When the application starts back up, I want a page that allows them to click a button to continue where they left off in their .cbz file viewing (i.e. they finished on page 56/100 in the previous session).

    It would also be nice to show a thumbnail of the last .jpg image that was viewed on the button they can click to restore a session as opposed to opening up a new one.

    I'm aware that you can use QSettings to maintain things like the size of the GUI screen, but can I also use it to store the List data structure and the index in that list that the user left off on?

    Or will I have to use something like QtSQL?

    Thanks in advance.


  • Moderators

    @forlorn said in QSettings to save data structure:

    I'm aware that you can use QSettings to maintain things like the size of the GUI screen, but can I also use it to store the List data structure and the index in that list that the user left off on?

    yes, when you implement the stream operators for your types you want to store.


Log in to reply