[Interest] QDatastream, QMap, QImage serialization

Jason H jhihn at gmx.com
Mon May 21 02:27:31 CEST 2018


Why is QImage even a GUI type? 99% of what I do with QImage is not for GUI. I can understand that QPixmap is GUI, but to me QImage is i/o and pixel/metadata manipulation (using scanline() where appropriate) . Yes, occasionally I use a QPainter on one, but that does not beed to be bound to a windowing system. A non-GUI raster painter would be sufficient.

I (Qt?) uses QPixmap whenever it has to display an image. 


> Sent: Sunday, May 20, 2018 at 11:54 AM
> From: "Thiago Macieira" <thiago.macieira at intel.com>
> To: interest at qt-project.org
> Subject: Re: [Interest] QDatastream, QMap, QImage serialization
>
> On Sunday, 20 May 2018 07:26:47 -03 Konstantin Shegunov wrote:
> > On Thu, May 17, 2018 at 5:58 PM, Thiago Macieira <thiago.macieira at intel.com>
> > wrote:
> > > On Thursday, 17 May 2018 05:01:18 PDT Jean-Michaƫl Celerier wrote:
> > > > Is there a reason why calling qRegisterStreamOperators<QImage>() would't
> > > > work ?
> > > 
> > > Because the vector containng the list of function pointers doesn't exist
> > > for
> > > metatypes < QMetaType::User.
> > 
> > Is this by design, or just an unfortunate legacy?
> 
> It's by design that the vector starts at QMetaType::User.
> 
> > I would've expected
> > (obviously wrongly) that the core classes provide and support all the
> > functionalities of properly registered custom types.
> 
> Except where it was too hard and we haven't done it. Serialisation appears to 
> be one such case.
> 
> > And a follow up question: I'm not intimate with the internals, so is it
> > feasible to actually bring this to consistency and have the stream
> > operators registered in the meta-type system for the core classes?
> 
> Yes. Patch accepted. See qguivariant.cpp: the two save and load functions are 
> currently null pointers. Replace with actual functions that save QtGui types 
> to a QDataStream and properly loaded back.
> 
> -- 
> 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
>



More information about the Interest mailing list