I'm not familar with that function,  but I would guess because it's a QVariant holding a QImage?
There already are those stream operators, and I think they are already registered.
 
I'm not understanding why QVariatn doesn't know how/why to call it?
I'd figure that QVariant would write the type, the 0 byte, then have the object QDataStream& operator << into the QIODevice itself?
 
Sent: Thursday, May 17, 2018 at 8:02 AM
From: "Jean-Michaël Celerier" <jeanmichael.celer...@gmail.com>
To: "Jean-Michaël Celerier" <jeanmichael.celer...@gmail.com>
Cc: "Thiago Macieira" <thiago.macie...@intel.com>, interest <interest@qt-project.org>
Subject: Re: [Interest] QDatastream, QMap, QImage serialization
Sorry, I meant qRegisterMetaTypeStreamOperators<QImage>()
 
 
 
-------
Jean-Michaël Celerier
 
On Thu, May 17, 2018 at 2:01 PM, Jean-Michaël Celerier <jeanmichael.celer...@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
 
On Wed, May 16, 2018 at 11:52 PM, Thiago Macieira <thiago.macie...@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@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to