Help Test QtPrintSupport Changes in Qt 5.3 Beta 1

Significant changes have been made to the internals of QtPrintSupport in Qt 5.3 in an effort to resolve many of the page layout bugs and inconsistent behaviour across platforms, as well as preparing the way for printing on mobile devices and cloud printing in Qt 5.4 or 5.5. These changes were not in Alpha 1, but have now been merged for the Beta 1 release and need through testing to ensure they work properly with the wide variety of print devices and drivers out there.

The main changes on the painting side are:

  • A new QPageSize class in QtGui to abstract handling of page sizes and names, which supports 123 Postscript standard page sizes.
  • A new QPageLayout class in QtGui to abstract handling of page layout and paint rects in a consistent way, i.e. page size, orientation and margins.
  • QPdfWriter in QtGui uses QPageLayout to manage the PDF page layout, and you can now properly set the orientation of the PDF.
  • QPrinter in QtPrintSupport uses QPageLayout to manage the document page layout consistently between all platforms and the PDF file printer.

The main changes on the printing side in QtPrintSupport are:

  • A new QPA class QPlatformPrintDevice to abstract the print device handling, which will make new platform implementations easier.
  • The existing Win/Mac/Cups platform plugins have completely new print device implementations of the same full and consistent feature set on all platforms.
  • Mac now supports changing individual page orientation during a print job, and setting of Collate Copies and Document Name
  • Setting the Document Creator is now supported on all platforms
  • Mac and Win both now support setting of the Duplex Mode (not in beta 1, should be in final release)
  • QPrinterInfo has new api to expose more details about the print device. New api is provided to query for available printer names which should be faster than the old api that reurned QPrinterInfo instances and which could be slow when used across a network. You can query for the supported and default QPageSizes, with the old page size and name api being deprecated. You can also query the printer state, if it is a remote printer, if it supports custom page sizes, what the minimum and maximum physical paper sizes are, and what physical print resolutions are supported.

There have also been numerous other bug fixes and code clean-ups with more on the way, of particular note Windows printing now positions text correctly in relation to graphics.

An important note for Linux packagers is that QtPrintSupport now requires CUPS 1.4, which most distributions have been using since at least 2009, but this does mean that RHEL 5 will no longer be supported by QtPrintSupport.  Optional support for CUPS 1.6 is planned for Qt 5.4.

These changes in the backend are obviously significant, especially the full re-write of the platform code that talks to the physical print devices. While the code has been tested on a number of major-brand printers, the sheer variety of print devices and variable quality of print drivers (especially on Windows) means we need your help with the Beta to make sure there are no regressions or crashes. In particular, I'd like some real world testing on printers attached to remote print servers.

So how can you help? If you use the binary downloads, then you will need to build and test the examples found in widgets/richtext/textedit and widgets/painting/fontsampler, or just test with your own app printing code.  Check that the print dialog works correctly and the printed and PDF output appears as you would expect for all printers you have available.

If you build your own Qt, then you can run more tests. Firstly, use either Qt 5.2 or Qt 5.3 Alpha 1 to print out some "Before" documents for comparison purposes.  Run the following test/example code at different page sizes and on all your available printers, as well as printing to PDF:


Next copy the output of the following test to somewhere safe:


Finally, run the main auto tests to make sure the old code passes testing with your printers (if you have multiple printers you'll need to set each one to be default before running the test for it):


Now build Qt 5.3 Beta 1 and repeat all the above steps, as well as the following new tests:


Look at the qprintdevice_dump output: do all the reported details look correct?

Play with the manual print dialog test: does changing the page sizes and other settings work, especially custom pages?

Compare the Before and After samples, easiest done by overlaying one on top of the other and holding it up to a bright light. There may be small differences, use your judgement to decide if they are better or worse.

If you have previously reported print layout bugs, then please retest these.  If you have your own code or app that uses printing then you can also test with that.

If you find any problems, then please open a bug at and attach the output from all of the above, both before and after, and if possible scans of any printouts that look wrong to you.

In Qt 5.4, free time permitting, I'm planning to improve our support for print job and print settings management, and in 5.4 or 5.5 introduce support for cloud and mobile print services. I'm also looking at what bug fixes can be back-ported to Qt 4.8.  If that's something you'd like to be involved in, or your company might be interested in sponsoring development of, then drop me a line and we can get coding.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

  Hello John, I'm only an


Hello John,

I'm only an end-user, so I cannot do any testing or sponsor it. But I strongly hope there will be sponsors to backport fixes to the 4.8 line. In the current KDE SC 4, there is at least one serious bug (margin settings are lost), which really makes KDE 4 unuseable in a productive office environment.

Also from what I gathered so far is that with the upcoming KF5 there will be no KDE specific print dialog, but it will all be provided by Qt. Is that correct?

In any case, the print dialog needs a boost in usability. For instance the page range setting is hidden behind an extra click on options, although its most often needed. Furthermore, when I'm at page 38 in a document and I want to print this exact page, the page number is not carried over into the print dialog, but instead I have to type it in by hand.

That said I really hope to see some improvements in this usability area as well and Thanks for your work!


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.