Recommended solution to recover the value if user click on cancel
-
Assume I have a dialog for users to setup their settings, if the users click ok button, the dialog should close and keep the value, if the users click cancel button, the value should revert to the value before users change the value.
This is not difficult to do, but quite verbose, I have to save every value manually. Do Qt provide us some tools to make things easier to handle?Thanks
-
Do you use QSettings?
Have a look at this example
It uses QSettings and slots that do what you want.Eddy
-
@Eddy said in Recommended solution to recover the value if user click on cancel:
Do you use QSettings?
Have a look at this example
It uses QSettings and slots that do what you want.Eddy
Yap, I use it to mange lots of options before(github), wonder are there exist better way to manage the value of this kind of task.
-
Hi
Just so I understand. When user click Cancel, the dialog stays open and the widgets resets the state ?Normally I wait until Ok is pressed to save, so when user press Cancel, i simply just close dialog.
Sounds like your use case is different ?