[PyQt] QVariant doesn't save python list

Phil Thompson phil at riverbankcomputing.com
Sat Nov 8 14:37:22 GMT 2008


On Sat, 8 Nov 2008 16:01:55 +0200, Keith <keithbegreat at gmail.com> wrote:
> Hi
> 
> I've written a piece of code that seems to work fine in PyQt 4.0.1 which
is
> in Debian Etch. Basically it just takes a list of string and saves it
using
> QSettings object. The code is similar to:
> 
> settings = QSettings()
> 
> strings = [u'string0', u'string1', u'string2', u'string3', u'string4',
> u'string5', u'string6', u'string7', u'string8', u'string9']
> 
> settings.saveValue("Header", QVariant(strings))
> 
> This works fine, but on PyQt 4.4.3 it gives an error:
> 
>     QVariant::save: unable to save type 429.
> 
> I've tried using QStringList instead, but no luck.
> 
> What is causing this and is there anything I can do about it?

It should work with current snapshots (and the imminent v4.4.4).

Phil


More information about the PyQt mailing list