0

I have a gui with different kinds of qt objects such as QListWidget, QLineEdit and QComboBox.

What would be the best way to save all of the current settings to a file (by clicking a Push Button for example) and then load them? (after closing and reopening the gui and press another Push Button to load).

Thanks!

Gambit2007
  • 3,260
  • 13
  • 46
  • 86
  • So all i have to do is create a QSettings object and it would automatically save all of the settings and valued for me? Also, what if i want to save multiple settings in multiple files and have the user able to browse through his computer and load his a specific file? – Gambit2007 Jun 17 '16 at 17:58
  • No, you have to add all the data you want to save to the `QSettings` manually, and then re-apply it to the GUI manually. – Brendan Abel Jun 17 '16 at 17:59
  • Could i save python internal data structures such as a dictionary? And would that files thing i mentioned be possible? – Gambit2007 Jun 17 '16 at 18:13
  • Generally, anything that can be serialized (using `pickle` or `json`) can be saved. – Brendan Abel Jun 17 '16 at 18:15
  • Okay i'll try it, thanks! – Gambit2007 Jun 17 '16 at 18:25

0 Answers0