[PyQt] Re: Problem after upgrade to PyQt 4.6.2

Prafulla Kiran prafulla at tachyontech.net
Mon Nov 23 12:38:48 GMT 2009


Hi Phil,

The following piece of code throws up the error messages that Detlev has 
mentioned. Is there something wrong that I am doing here ?
The same piece of code works fine in PyQt 4.5.* and 4.6.1

from PyQt4 import QtCore


settings_ = QtCore.QSettings("Foo", "Bar")

qString = QtCore.QString("teamtalk.im")

settings_.setValue("URL", QtCore.QVariant(qString))

This throws up:   /QVariant::save: unable to save type 256.   /in PyQt 4.6.2
//

Regards,
Prafulla
//



Phil Thompson wrote:
> On Sun, 22 Nov 2009 13:58:00 +0100, detlev <detlev at die-offenbachs.de>
> wrote:
>   
>> Hi,
>>
>> after upgrading to PyQt4 4.6.2 (from 4.6.1) I get error messages like
>>
>> QVariant::save: unable to save type 256.
>> QVariant::load: unable to load type 256.
>>
>> What does this mean? With 4.6.1 everything was ok.
>>     
>
> I don't think it has anything to do with v4.6.2.
>
> Although any object can be converted to and from a QVariant it is not true
> that any QVariant can be saved to and loaded from files.
>
> My guess is that you have written a value (at some time in the past) that
> can't be saved and not noticed the Qt error message. Note that QSettings
> still writes a value in this case.
>
> There is a bug (fixed in tonight's snapshot) where an exception isn't
> raised when QSettings tries to read an unreadable value, but this bug has
> been there since PyQt v4.5.
>
> For v4.7 I will add support for saving and loading objects that can be
> pickled - but that still won't cover all objects.
>
> Phil
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 8.5.425 / Virus Database: 270.14.78/2521 - Release Date: 11/23/09 07:52:00
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20091123/abf36136/attachment.html


More information about the PyQt mailing list