PlanetQt

warning: Creating default object from empty value in /home3/johnlayt/public_html/modules/taxonomy/taxonomy.pages.inc on line 34.
Appear on PlanetQt

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:

qtbase/tests/manual/dialogs
qtbase/examples/widgets/richtext/textedit

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

qtbase/tests/auto/printsupport/kernel/qprinterinfo

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):

qtbase/tests/auto/printsupport/kernel/qprinter

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

qtbase/tests/auto/printsupport/kernel/qprintdevice
qtbase/tests/manual/qprintdevice_dump

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 bugreports.qt-project.org 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.

Syndicate content