May 2019
Intermediate to advanced
542 pages
13h 37m
English
As powerful as they are, QSettings objects can't store just anything. All values in the settings object are stored as QVariant objects, so only objects that can be cast to QVariant can be stored. This encompasses a long list of types, including nearly any Python built-in type and most of the data classes from QtCore. Even function references can be stored (though not the function definitions).
Unfortunately, in the event that you try to store an object that cannot be properly stored, QSettings.setValue() will neither throw an exception or return an error. It will print a warning to the console and store something that will likely not be useful, for example:
app = qtw.QApplication([])s = qtc.QSettings('test')s.setValue('app', ...Read now
Unlock full access