When using v2 of the API for QString and QVariant, if you write a boolean value to a QSettings file and then read the value back in from a different session, it comes back as a unicode string. Example:<br><br>##################<br>
# write out the qsettings file<br>##################<br>import sip<br>sip.setapi('QVariant', 2)<br>sip.setapi('QString', 2)<br><br>from PyQt4 import QtCore<br><br>settings = QtCore.QSettings()<br>settings.setValue("foo", False)<br>
<br>##################<br>
# separate session, read in the qsettings file<br>
##################<br>import sip<br>
sip.setapi('QVariant', 2)<br>
sip.setapi('QString', 2)<br>
<br>
from PyQt4 import QtCore<br>
<br>
settings = QtCore.QSettings()<br>
val = settings.value("foo")<br>print "val = %s (%s)" % (val, type(val))<br>
<br>