[PyQt] QSettings.value() returns string instead of bool

Hans-Peter Jansen hpj at urpla.net
Sun Mar 6 14:48:19 GMT 2011


On Sunday 06 March 2011, 15:13:13 Andreas Pakulat wrote:
> On 06.03.11 13:23:53, Phil Thompson wrote:
> > On Sun, 6 Mar 2011 13:49:16 +0100, Andreas Pakulat <apaku at gmx.de> 
wrote:
> > > Hi,
> > >
> > > I'm using sip API v2 for QVariant here and using
> > > QSettings.setValue/value does not work correctly for booleans.
> > > See the attached two scripts. In write.py everything looks good,
> > > I can store and get back a Python boolean. But running read.py
> > > which only reads from the QSettings object always returns a
> > > string instead of a boolean value. It almost looks like the wrong
> > > QSettings overload is being called...
> > >
> > > My versions are:
> > > Qt4: 4.7.1
> > > PyQt4: 4.7.3
> > > Python: 2.6.6
> > > Sip: 4.10.2
> > >
> > > Is this something thats fixed in newer PyQt4 versions maybe?
> >
> > See...
> >
> > http://www.riverbankcomputing.com/static/Docs/PyQt4/html/python_v3.
> >html#qsettings
>
> Seems I was too fast with the thanks :(
> In the above mentioned version of PyQt4 the QSettings.value()
> function has no type argument. So I guess I'm stuck with manual
> conversion for now.

Yes.

See this discussion for the issue:
http://www.riverbankcomputing.com/pipermail/pyqt/2010-December/028915.html
http://www.riverbankcomputing.com/pipermail/pyqt/2010-December/028919.html

and this for the related announcement:
http://www.riverbankcomputing.com/pipermail/pyqt/2011-January/029032.html

which happened as: PyQt v4.8.3 and SIP v4.12.1.

Pete


More information about the PyQt mailing list