[Interest] QDatastream, QMap, QImage serialization

Jean-Michaël Celerier jeanmichael.celerier at gmail.com
Thu May 17 14:02:20 CEST 2018


Sorry, I meant qRegisterMetaTypeStreamOperators<QImage>()



-------
Jean-Michaël Celerier
http://www.jcelerier.name

On Thu, May 17, 2018 at 2:01 PM, Jean-Michaël Celerier <
jeanmichael.celerier at gmail.com> wrote:

> > The problem is that QVariant doesn't know how to call it.
>
> Is there a reason why calling qRegisterStreamOperators<QImage>() would't
> work ?
>
>
>
>
> -------
> Jean-Michaël Celerier
> http://www.jcelerier.name
>
> On Wed, May 16, 2018 at 11:52 PM, Thiago Macieira <
> thiago.macieira at intel.com> wrote:
>
>> On Wednesday, 16 May 2018 14:38:08 PDT Jérôme Godbout wrote:
>> > You will need to provide your own
>> >
>> > QDataStream& operator<<(QDataStream& ds, const QImage& img)
>>
>> That's not needed (and won't compile). It already exists.
>>
>> The problem is that QVariant doesn't know how to call it. So when you
>> have a
>> QImage inside a QVariant and you try to serialise that QVariant, you get
>> nothing useful.
>>
>> --
>> Thiago Macieira - thiago.macieira (AT) intel.com
>>   Software Architect - Intel Open Source Technology Center
>>
>>
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180517/9d8a9bdd/attachment.html>


More information about the Interest mailing list