<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Phil,<br>
<br>
The following piece of code throws up the error messages that Detlev
has mentioned. Is there something wrong that I am doing here ?<br>
The same piece of code works fine in PyQt 4.5.* and 4.6.1<br>
<br>
<address>from PyQt4 import QtCore<br>
</address>
<address><br>
settings_ = QtCore.QSettings("Foo", "Bar")</address>
<address>qString = QtCore.QString("teamtalk.im")</address>
<address>settings_.setValue("URL", QtCore.QVariant(qString))<br>
<br>
</address>
This throws up: <i>QVariant::save: unable to save type 256. </i>in
PyQt 4.6.2<br>
<i></i>
<address><br>
</address>
Regards,<br>
Prafulla
<address><i></i></address>
<br>
<br>
Phil Thompson wrote:
<blockquote cite="mid:65c315439f826b658bc9b3b6e4719f38@localhost"
type="cite">
<pre wrap="">On Sun, 22 Nov 2009 13:58:00 +0100, detlev <detlev@die-offenbachs.de>
wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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.
</pre>
</blockquote>
<pre wrap=""><!---->
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@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt</pre>
<pre wrap="">
<hr size="4" width="90%">
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
</pre>
</blockquote>
<br>
</body>
</html>