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. qt session
Forum Updated to NodeBB v4.3 + New Features

qt session

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 4 Posters 1.4k 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.
  • S Offline
    S Offline
    shree_121
    wrote on 31 Aug 2018, 07:55 last edited by
    #1

    how to save sessions of Qt gui app. My QT GUi app requirement is that i used watchdog timer function to restart the system in for loop so is it possible that after every restart the app will excute the next loop not from first loop. please advise.

    J 1 Reply Last reply 31 Aug 2018, 08:09
    0
    • S shree_121
      31 Aug 2018, 07:55

      how to save sessions of Qt gui app. My QT GUi app requirement is that i used watchdog timer function to restart the system in for loop so is it possible that after every restart the app will excute the next loop not from first loop. please advise.

      J Offline
      J Offline
      JonB
      wrote on 31 Aug 2018, 08:09 last edited by JonB
      #2

      @shree_121
      No idea what this might mean? "Sessions"? "Restart the system"? "excute the next loop not from first loop"? ...

      S 1 Reply Last reply 31 Aug 2018, 09:58
      0
      • J JonB
        31 Aug 2018, 08:09

        @shree_121
        No idea what this might mean? "Sessions"? "Restart the system"? "excute the next loop not from first loop"? ...

        S Offline
        S Offline
        shree_121
        wrote on 31 Aug 2018, 09:58 last edited by
        #3

        @JonB thanks for reply. I am restarting CPU in for loop so after restart my application should autolaunch and restore all for loop values sothat it will execute second loop. Is it possible?

        J 1 Reply Last reply 31 Aug 2018, 10:00
        0
        • S shree_121
          31 Aug 2018, 09:58

          @JonB thanks for reply. I am restarting CPU in for loop so after restart my application should autolaunch and restore all for loop values sothat it will execute second loop. Is it possible?

          J Offline
          J Offline
          JonB
          wrote on 31 Aug 2018, 10:00 last edited by
          #4

          @shree_121
          You are rebooting the machine inside a "for" loop?? And after reboot you want the application to start up again, get to the same place it was in some for loop in your application code, and restart from there? Seriously?

          S 1 Reply Last reply 31 Aug 2018, 10:08
          3
          • J JonB
            31 Aug 2018, 10:00

            @shree_121
            You are rebooting the machine inside a "for" loop?? And after reboot you want the application to start up again, get to the same place it was in some for loop in your application code, and restart from there? Seriously?

            S Offline
            S Offline
            shree_121
            wrote on 31 Aug 2018, 10:08 last edited by
            #5

            @JonB yes, not possible??

            J 1 Reply Last reply 31 Aug 2018, 10:34
            0
            • S shree_121
              31 Aug 2018, 10:08

              @JonB yes, not possible??

              J Offline
              J Offline
              JonB
              wrote on 31 Aug 2018, 10:34 last edited by JonB
              #6

              @shree_121
              Well it sounds pretty crazy, but if that's what you really want to do...

              Of course it is not possible to have a program restart at some arbitrary point just because you feel like it (other than maybe if you're under Linux and deliberately create a core dump and reload from there, but we won't get into that...).

              You will have, in some shape or form, to save whatever you need to know (your "session state") to some external file/registry/whatever just before you restart the machine, and then when your program gets reloaded (which won't happen automatically, unless you have it auto-starting on boot) it will have to read that data and have code to get it back to whatever the appropriate point is in your code to be able to continue from where it left off.

              None of which has anything to do with Qt....

              S 1 Reply Last reply 31 Aug 2018, 12:06
              1
              • J JonB
                31 Aug 2018, 10:34

                @shree_121
                Well it sounds pretty crazy, but if that's what you really want to do...

                Of course it is not possible to have a program restart at some arbitrary point just because you feel like it (other than maybe if you're under Linux and deliberately create a core dump and reload from there, but we won't get into that...).

                You will have, in some shape or form, to save whatever you need to know (your "session state") to some external file/registry/whatever just before you restart the machine, and then when your program gets reloaded (which won't happen automatically, unless you have it auto-starting on boot) it will have to read that data and have code to get it back to whatever the appropriate point is in your code to be able to continue from where it left off.

                None of which has anything to do with Qt....

                S Offline
                S Offline
                shree_121
                wrote on 31 Aug 2018, 12:06 last edited by
                #7

                @JonB
                Thanks for your help.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 31 Aug 2018, 22:00 last edited by
                  #8

                  Hi,

                  Depending on how you do it, QSessionManager might be of use. Note that this is a functionality that's usually tied to the desktop environment in use.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  S 1 Reply Last reply 3 Sept 2018, 03:39
                  1
                  • S SGaist
                    31 Aug 2018, 22:00

                    Hi,

                    Depending on how you do it, QSessionManager might be of use. Note that this is a functionality that's usually tied to the desktop environment in use.

                    S Offline
                    S Offline
                    shree_121
                    wrote on 3 Sept 2018, 03:39 last edited by
                    #9

                    @SGaist Thank you
                    Do you have any small example how QsessionManager will work?

                    R 1 Reply Last reply 3 Sept 2018, 04:21
                    0
                    • S shree_121
                      3 Sept 2018, 03:39

                      @SGaist Thank you
                      Do you have any small example how QsessionManager will work?

                      R Offline
                      R Offline
                      Ratzz
                      wrote on 3 Sept 2018, 04:21 last edited by
                      #10

                      @shree_121
                      Here is an small example for Handling X11 Session Management .

                      --Alles ist gut.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        shree_121
                        wrote on 6 Sept 2018, 07:21 last edited by
                        #11

                        Hi@Ratzz ,
                        i followed your example i am not able to restore pushButton clicked event. Can Qsessionmanager also restores the QpushButton press events? Because i don't want start my for loop again and if i have to click on button after reboot then for loop starts from zero.

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 6 Sept 2018, 21:39 last edited by
                          #12

                          No, you can't restore such a thing. You have to design your loop so it can be started from a "save point". Then on startup reload the data and that "save point" and start the loop.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          1

                          8/12

                          31 Aug 2018, 22:00

                          • Login

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