Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Maintaining the state of application
QtWS25 Last Chance

Maintaining the state of application

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 328 Views
  • 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.
  • KiraK Offline
    KiraK Offline
    Kira
    wrote on last edited by
    #1

    Hi,
    Is there a mechanism in qt to preserve the state of the application
    For example i have a camera device scanning a platform and suddenly the power goes off.
    How can i continue the scanning from that point or maintain the state of application to start from
    that point

    JonBJ 1 Reply Last reply
    0
    • KiraK Kira

      Hi,
      Is there a mechanism in qt to preserve the state of the application
      For example i have a camera device scanning a platform and suddenly the power goes off.
      How can i continue the scanning from that point or maintain the state of application to start from
      that point

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @kira
      There is no standard technology for "Maintaining the state of application". Qt neither helps nor hinders this. I don't know about the specifics of your scanning, but it is up to you, the programmer, to save whatever state you need as you go along and to write code which uses that to restart from a similar situation.

      1 Reply Last reply
      2
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by mrjj
        #3

        Hi
        You can get help by using
        https://doc.qt.io/qt-5/qmainwindow.html#saveState
        https://doc.qt.io/qt-5/qmainwindow.html#restoreState
        but any state that is related to app related activities must be handled manually.
        Often QSetting class is used to store the settings store in.

        1 Reply Last reply
        2
        • fcarneyF Offline
          fcarneyF Offline
          fcarney
          wrote on last edited by
          #4

          If you have definite progress points and can verify those points. Then you can simply have your program look for a job in progress and continue from that point on restart. I had a script I wrote in Python. It would look at the filenames in a directory. If they existed it would start after the last file to start processing data again. So you could have incremental saved files for something like this.

          Another option is running this from a laptop and/or ups.

          C++ is a perfectly valid school of magic.

          1 Reply Last reply
          2

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved