<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def saveSettings(self, groupName=None):
 """ Writes the registry items into the persistent settings store. """

        groupName = groupName if groupName else self.settingsGroupName
        settings = QtCore.QSettings()
        logger.info("Saving {} to: {}".format(groupName, settings.fileName()))

        settings.remove(groupName) # start with a clean slate
        settings.beginGroup(groupName)
        try:
            for itemNr, item in enumerate(self.items):
                key = "item-{:03d}".format(itemNr)
                value = repr(item.asDict())
                settings.setValue(key, value)
        finally:
            settings.endGroup()