QSettings is a cross-platform abstraction that can be used to preserve preferences, so hopefully this eliminates the use of#IFDEFs
I also found that it has really good performance. So good that I just installed an event listener and named save()for each individual event.
, :
def __init__(self, *args, **kwargs):
self.installEventFilter(self)
def eventFilter(self, obj, event):
self.save()
return False
save() :
self.app.settings.setValue(self.state_key, self.header.saveState())
self.app.settings.setValue(self.geometry_key, self.header.saveGeometry())
self.app.settings.setValue("connect_timeout_spinBox_value", self.connect_timeout_spinBox.value())
self.app.settings.setValue("reveal_downloads_checkbox_checked", self.reveal_downloads_checkbox.checkState())
, , , , .
(-) , save() s , QSettings .
, / QSettings, . , / . , .