Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-38334

QPrinter.setPrinterName() for a native printer fails to set output format to native

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.2.1
    • 5.0.2
    • GUI: Printing
    • 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().

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            johnlayt John Layt
            bootchk lloyd konneker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes