Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
5.0.2
-
None
-
Linux, Ubuntu 13.10, Qt5.0.2 ( PyQt5 )
Description
Call QPrinter.setOutputForma(PDF). Set a known, real, native printer using QPrinter.setPrinterName(). Then outputFormat() still incorrectly returns QPrinter.PdfFormat.
Attached Python program demonstrates.
My analysis is that qprintersupport.cpp QPrinterPrivate::initEngines() only sets local variable outputFormat, and never sets d->outputFormat. I could be wrong.
Importance: I don't know the code well, but since it includes at least one if stmt on d->outputFormat, this could be a contributing factor to other reported bugs? The docs don't explicitly say that outputFormat() returns the format of the current printer.
The docs are very loose about using the word 'printer'. I think the docs should make a clearer distinction between the current printer and the QPrinter object. The current printer is state of the QPrinter object. The docs could also be clearer that setPrinterName() is setting that state, not just a renaming operation, in other words, the method should be called setPrinterByName().