qt session
-
-
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.
@shree_121
No idea what this might mean? "Sessions"? "Restart the system"? "excute the next loop not from first loop"? ... -
@shree_121
No idea what this might mean? "Sessions"? "Restart the system"? "excute the next loop not from first loop"? ... -
@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?
@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? -
@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? -
@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....
-
@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....
-
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.
-
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.
-
@shree_121
Here is an small example for Handling X11 Session Management . -
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. -
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.