So I'm developing a GUI that consists of many widgets such as checkbox, buttons, radio-buttons, combo-box using Python Qt5. This GUI is to perform some calcualtion based on user choices. I'm trying to figure out how to go about saving all this data in a file and then repopulating those widgets when the user opens the same file.
My research lead me to QSetting class of Qt5 but that only saves the states of widgets.
For Example:
def writeSettings(self):
self.settings = QSettings("Moose Soft", "Clipper")
self.settings.beginGroup("MainWindow")
self.settings.setValue("size", self.size())
self.settings.setValue("pos", self.pos())
self.settings.endGroup()
def readSettings(self):
self.settings = QSettings("Moose Soft", "Clipper")
self.settings.beginGroup("MainWindow")
self.resize(settings.value("size", QSize(400, 400)).toSize())
self.move(settings.value("pos", QPoint(200, 200)).toPoint())
self.settings.endGroup()
But this is not doing what I want (or maybe I'm not aware of some of its functionalities?)
Summary: What I want is to have the user save the file and come back to that file after a while and the file should know which widgets was checked/used and repopulate only those. How do I approach this issue?
By the way, I'm new to GUI design :-/