[Development] Plans for printing in 5.3 onwards

John Layt jlayt at kde.org
Mon Jan 6 22:40:44 CET 2014


I've spent the last few weeks going over the current print support and
trying to map out a plan to improve things.  We've long intended to
create a new QtPrint module to replace QtPrintSupport in which we
separate the painting code from the print job management code and
support a more modern workflow including cloud printing.  However it's
been hard to get started as it's an all-or-nothing approach, and we
still need to maintian the old code in parallel.  The existing code
itself is in a strange state and needing quite some clean-ups still,
with a QPA plugin that has been only partially implemented, a lot of
code still in the main module behind platform ifdef's rather than in
the plugins, major inconsistencies between the behaviour of the
platform implementations and even ifdef'd public api.

Given my limited time, I've decided to take a different approach to
try build the new code over the next few releases as a new set of QPA
classes that are then used by the current public api in place of the
old plugin code, before later being used for the new public api.  This
would allow the new code to be throurghly tested with a working
front-end in progressive steps, give us a single platform plugin
code-base for both apis to be maintained throughout the Qt5 life-span,
improve the quality and consistency of the existing print support, and
allow new cloud-print plugins to be worked on in the interim so we
better understand their requirements.  Working on this as a qpa also
allows the api to develop organically over the next few releases
without having to worry about compatability issues.  Once the new qpa
classes are completed, then the new public api can be developed to
expose all the new features.

My aims for the 5.3 release will be to
* Define the new qpa print device api and implement support for the 3
core platforms
* Use this new class in QPrinterInfo and QPrintEngine to replace the
current print device code, ensuring behaviour is consistent across
* Remove all the ifdef'd api and platform-specific code from QPrinter,
ensuring api and behaviour is consistent across platforms
* Remove all platform-specific code from the widgets and dialogs
* Improve the auto test framework

Longer term, 5.4 could see the addition of the new qpa job ticket and
print settings api and their integration into the engines and dialogs,
and 5.5 could see the new public api.  One major sub-task in there
will be to try upgrade our PDF support to full PDF/A standard which
may affect the timing.

I have a work branch at [1] which implements the new
QPlatformPrintDevice api for the 3 platforms and integrates it so far
into QPrinterInfo and the Linux QPrintEngine.  It also has some new
classes QPageSize, QPageMargin and QPageLayout to remove lots of
duplicated and error-prone page and margin handling code.  Once the
Windows and Mac print engine integration is completed I'll start
pushing these for review.



P.S. If anyone wants this completed sooner, I'd be happy to discuss
sponsorship to allow me to work on it full-time for the next 6 months

[1] https://qt.gitorious.org/qt/odysseus-qtbase/commits/a19d77f78f071c207fc07e6c5f003f789d0daa3c

More information about the Development mailing list