I noticed this too, the serialization in the QSettings.sync function seems to write the bool value to the settings file as 'true' or 'false'.

As such when you then get the value again i.e value('useZip', False) it returns unicode instead of bool.


On 15/04/11 10:58, Eli Stevens (Gmail) wrote:
I'm seeing the following, and am trying to figure out if it's an error
in my application, or a bug in pyside.

         self.actions['toggleFooOption'].setChecked(self.settings.value('bar',
False))

That's connected to:

     @Slot(bool)
     def toggleFooOption(self, val):
         if self.settings.value('useZip', False) != val\:
             self.settings.setValue('useZip', val)

However, when i set that option in the UI, close the application, and
then restart on windows, self.settings.value('bar', False) returns
u'true' (ie. a string).  Looking in the registry shows a REG_SZ key,
which lines up.  On OSX, the program works fine.

Is anyone else seeing the same behavior?  It's possible that there's
something in my application (sadly, not open source, so I can't post
the whole thing) that's causing it, but it doesn't seem that way to
me.

Thanks,
Eli
_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

Reply via email to