[PyQt] QSettings.value() returns string instead of bool
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>
> > > 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.
> 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.
See this discussion for the issue:
and this for the related announcement:
which happened as: PyQt v4.8.3 and SIP v4.12.1.
More information about the PyQt