[Interest] QDatastream, QMap, QImage serialization

Jason H jhihn at gmx.com
Mon May 21 16:03:38 CEST 2018


Going through the list of Qt GUI classes, there are several that I think should be moved:
QImage
QStandardItem*
Matrix and Vector classes
QPdfWriter
QPen, QBrush, etc.
QText* QTextDocument et al.
QValidator et al.
QFont* (where applicable. QFontDatabase, QRawFont)
Various geometrics (QPolygon, QRegion)

I'm not sure if these should be moved to Qt Core, as it would add to that library's size or go into their own "visual" device indepenent library. Ideally, I want QImage supported in core. But the other ramification is you won't need a QGUIApplication or QApplication class and can stick to QCoreApplication. In the past I've had to pass a bogus window system to use it for a server based app. Could it use stub classes for those not wanting imaging capability in Qt Core?


> Sent: Monday, May 21, 2018 at 5:08 AM
> From: "Christian Gagneraud" <chgans at gmail.com>
> To: "Jean-Michaël Celerier" <jeanmichael.celerier at gmail.com>
> Cc: "Jason H" <jhihn at gmx.com>, "Thiago Macieira" <thiago.macieira at intel.com>, interest <interest at qt-project.org>
> Subject: Re: [Interest] QDatastream, QMap, QImage serialization
>
> On 21 May 2018 at 20:12, Jean-Michaël Celerier
> <jeanmichael.celerier at gmail.com> wrote:
> >> 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.
> >
> > +1 (and also QColor ! plenty of command-line apps that work with colors :p)
> 
> +1 (and also QPen and QBrush, they are (should be) just bundled properties)
> 
> Once i wrote a graphical document format library (load, store and
> models), that could have not depend on GUI at all if it didn't use
> QColor, QPen, QBrush.
> 
> Chris
> 
> >
> >
> > -------
> > Jean-Michaël Celerier
> > http://www.jcelerier.name
> >
> > On Mon, May 21, 2018 at 2:27 AM, Jason H <jhihn at gmx.com> wrote:
> >>
> >> 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
> >> >
> >> _______________________________________________
> >> Interest mailing list
> >> Interest at qt-project.org
> >> http://lists.qt-project.org/mailman/listinfo/interest
> >
> >
> >
> > _______________________________________________
> > Interest mailing list
> > Interest at qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/interest
> >
>



More information about the Interest mailing list