On Sun, 22 Jun 2008 15:21:07 -0700, "Adam Tenderholt"
<[EMAIL PROTECTED]> wrote:
> I've created a QVariant object by passing a Python object
> (specifically, a list of numpy arrays) to its constructor, and I'm
> trying to have it read into a QDataStream object. Unfortunately, it
> doesn't work and gives me the error 'QVariant::save: unable to save
> type 428.'. The relevant code is below:
> 
> ...
> mimeData = QtCore.QMimeData()
> encodedData = QtCore.QByteArray()
> stream = QtCore.QDataStream(encodedData, QtCore.QIODevice.WriteOnly)
> ...
> temp  = QtCore.QVariant(element.coords)
> stream << temp
> ...
> 
> As near as I can tell (printing debug messages immediately before and
> after), it has trouble with the 'stream << temp' line. Should I be
> doing something else, or can I not use QVariants in this way?
> 
> This is with Python 2.5.1 on a Mac running OS X 10.5.3 with Qt 4.4.0,
> sip 4.76, and PyQt 4.4.2.

While QVariant knows how to copy an arbitrary Python object (which is just
reference count manipulation) it doesn't know how to serialise one.

Phil

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to