[Interest] QDatastream, QMap, QImage serialization

Thiago Macieira thiago.macieira at intel.com
Mon May 21 19:27:55 CEST 2018


On Monday, 21 May 2018 11:03:38 -03 Jason H wrote:
> 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)

Polygon and region, matrix and vectors we could move. I was actually surprised 
that they weren't in QtCore earlier this year when I tried to write the CBOR 
serialisation for them and realised I couldn't from QtCore, as they aren't in 
that library.

The validators I don't know. They aren't GUI per se, but their use is done 
alongside GUI elements.

The standard item models could be merged with the other item models in 
separate library. But they shouldn't be moved to QtCore. All the rest are GUI 
by definition and will not move.

> 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?

Images are graphical, if not exactly user interface. What you want is a 
display-independent way to use graphical items. It seems all that is needed is 
a new feature to QGuiApplication, telling it to connect to no display service. 
We used to have that in Qt 4:

http://doc.qt.io/archives/qt-4.8/qapplication.html#QApplication-2
and http://doc.qt.io/archives/qt-4.8/qapplication.html#QApplication-3 had an 
extra parameter to the constructor telling it to remain a no-UI application 
but enable the graphical functionality.

It's possible that you can use QImage with just QCoreApplication. I wouldn't 
know, as I don't use QImage. But if it is meant to be done, I'd require it be 
documented as so.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center






More information about the Interest mailing list