Skip to content

PythonQt.QtGui.QPrinter · declarations 002

Back to PythonQt.QtGui.QPrinter

abort

abort() -> bool

X.abort() -> bool

Supplemental documentation: Qt 5 reference:

bool QPrinter::abort()

Aborts the current print run. Returns true if the print run was successfully aborted and printerState() will return QPrinter::Aborted; otherwise returns false.

It is not always possible to abort a print job. For example, all the data has gone to the printer but the printer cannot or will not cancel the job when asked to.

Upstream PySide2 reference signatures (binding differences may apply):

abort(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#abort

actualNumCopies

actualNumCopies() -> int

X.actualNumCopies() -> int

Upstream PySide2 reference signatures (binding differences may apply):

actualNumCopies(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#actualNumCopies

collateCopies

collateCopies() -> bool

X.collateCopies() -> bool

Supplemental documentation: Qt 5 reference:

bool QPrinter::collateCopies() const

Returns true if collation is turned on when multiple copies is selected. Returns false if it is turned off when multiple copies is selected. When collating is turned off the printing of each individual page will be repeated the numCopies() amount before the next page is started. With collating turned on all pages are printed before the next copy of those pages is started.

This function was introduced in Qt 4.1.

See also setCollateCopies().

Upstream PySide2 reference signatures (binding differences may apply):

collateCopies(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#collateCopies

colorMode

colorMode() -> Any

X.colorMode()

Supplemental documentation: Qt 5 reference:

QPrinter::ColorMode QPrinter::colorMode() const

Returns the current color mode.

See also setColorMode().

Upstream PySide2 reference signatures (binding differences may apply):

colorMode(self) -> PySide2.QtPrintSupport.QPrinter.ColorMode

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#colorMode

copyCount

copyCount() -> int

X.copyCount() -> int

Supplemental documentation: Qt 5 reference:

int QPrinter::copyCount() const

Returns the number of copies that will be printed. The default value is 1.

This function was introduced in Qt 4.7.

See also setCopyCount() and supportsMultipleCopies().

Upstream PySide2 reference signatures (binding differences may apply):

copyCount(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#copyCount

creator

creator() -> str

X.creator() -> str

Supplemental documentation: Qt 5 reference:

QString QPrinter::creator() const

Returns the name of the application that created the document.

See also setCreator().

Upstream PySide2 reference signatures (binding differences may apply):

creator(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#creator

devType

devType() -> int

X.devType() -> int

Upstream PySide2 reference signatures (binding differences may apply):

devType(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#devType

docName

docName() -> str

X.docName() -> str

Supplemental documentation: Qt 5 reference:

QString QPrinter::docName() const

Returns the document name.

See also setDocName() and QPrintEngine::PrintEnginePropertyKey.

Upstream PySide2 reference signatures (binding differences may apply):

docName(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#docName

doubleSidedPrinting

doubleSidedPrinting() -> bool

X.doubleSidedPrinting() -> bool

Upstream PySide2 reference signatures (binding differences may apply):

doubleSidedPrinting(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#doubleSidedPrinting

duplex

duplex() -> Any

X.duplex()

Supplemental documentation: Qt 5 reference:

QPrinter::DuplexMode QPrinter::duplex() const

Returns the current duplex mode.

This function was introduced in Qt 4.4.

See also setDuplex().

Upstream PySide2 reference signatures (binding differences may apply):

duplex(self) -> PySide2.QtPrintSupport.QPrinter.DuplexMode

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#duplex

fontEmbeddingEnabled

fontEmbeddingEnabled() -> bool

X.fontEmbeddingEnabled() -> bool

Supplemental documentation: Qt 5 reference:

bool QPrinter::fontEmbeddingEnabled() const

Returns true if font embedding is enabled.

This function was introduced in Qt 4.1.

See also setFontEmbeddingEnabled().

Upstream PySide2 reference signatures (binding differences may apply):

fontEmbeddingEnabled(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#fontEmbeddingEnabled

fromPage

fromPage() -> int

X.fromPage() -> int

Supplemental documentation: Qt 5 reference:

int QPrinter::fromPage() const

Returns the number of the first page in a range of pages to be printed (the "from page" setting). Pages in a document are numbered according to the convention that the first page is page 1.

By default, this function returns a special value of 0, meaning that the "from page" setting is unset.

Note: If fromPage() and toPage() both return 0, this indicates that the whole document will be printed.

This function was introduced in Qt 4.1.

See also setFromTo() and toPage().

Upstream PySide2 reference signatures (binding differences may apply):

fromPage(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#fromPage

fullPage

fullPage() -> bool

X.fullPage() -> bool

Supplemental documentation: Qt 5 reference:

bool QPrinter::fullPage() const

Returns true if the origin of the printer's coordinate system is at the corner of the page and false if it is at the edge of the printable area.

See setFullPage() for details and caveats.

See also setFullPage() and pageLayout().

Upstream PySide2 reference signatures (binding differences may apply):

fullPage(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#fullPage

getPageMargins

getPageMargins(left: Any, top: Any, right: Any, bottom: Any, unit: Any) -> Any

X.getPageMargins(left, top, right, bottom, unit)

Upstream PySide2 reference signatures (binding differences may apply):

getPageMargins(self, unit: PySide2.QtPrintSupport.QPrinter.Unit) -> typing.Tuple[float, float, float, float]

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#getPageMargins

isValid

isValid() -> bool

X.isValid() -> bool

Supplemental documentation: Qt 5 reference:

bool QPrinter::isValid() const

Returns true if the printer currently selected is a valid printer in the system, or a pure PDF printer; otherwise returns false.

To detect other failures check the output of QPainter::begin() or QPrinter::newPage().

    QPrinter printer;
    printer.setOutputFormat(QPrinter::PdfFormat);
    printer.setOutputFileName("/foobar/nonwritable.pdf");
    QPainter painter;
    if (! painter.begin(&printer)) { // failed to open file
        qWarning("failed to open file, is it writable?");
        return 1;
    }
    painter.drawText(10, 10, "Test");
    if (! printer.newPage()) {
        qWarning("failed in flushing page to disk, disk full?");
        return 1;
    }
    painter.drawText(10, 10, "Test 2");
    painter.end();

This function was introduced in Qt 4.4.

See also setPrinterName().

Upstream PySide2 reference signatures (binding differences may apply):

isValid(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#isValid

metric

metric(arg__1: Any) -> int

X.metric(arg__1) -> int

Upstream PySide2 reference signatures (binding differences may apply):

metric(self, arg__1: PySide2.QtGui.QPaintDevice.PaintDeviceMetric) -> int

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#metric

newPage

newPage() -> bool

X.newPage() -> bool

Supplemental documentation: Qt 5 reference:

[override virtual] bool QPrinter::newPage()

Reimplements: QPagedPaintDevice::newPage().

Tells the printer to eject the current page and to continue printing on a new page. Returns true if this was successful; otherwise returns false.

Calling newPage() on an inactive QPrinter object will always fail.

Upstream PySide2 reference signatures (binding differences may apply):

newPage(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#newPage

numCopies

numCopies() -> int

X.numCopies() -> int

Upstream PySide2 reference signatures (binding differences may apply):

numCopies(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#numCopies

orientation

orientation() -> Any

X.orientation()

Upstream PySide2 reference signatures (binding differences may apply):

orientation(self) -> PySide2.QtPrintSupport.QPrinter.Orientation

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#orientation

outputFileName

outputFileName() -> str

X.outputFileName() -> str

Supplemental documentation: Qt 5 reference:

QString QPrinter::outputFileName() const

Returns the name of the output file. By default, this is an empty string (indicating that the printer shouldn't print to file).

See also setOutputFileName() and QPrintEngine::PrintEnginePropertyKey.

Upstream PySide2 reference signatures (binding differences may apply):

outputFileName(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#outputFileName

outputFormat

outputFormat() -> Any

X.outputFormat()

Supplemental documentation: Qt 5 reference:

QPrinter::OutputFormat QPrinter::outputFormat() const

Returns the output format for this printer.

This function was introduced in Qt 4.1.

See also setOutputFormat().

Upstream PySide2 reference signatures (binding differences may apply):

outputFormat(self) -> PySide2.QtPrintSupport.QPrinter.OutputFormat

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#outputFormat

pageLayout

pageLayout() -> Any

X.pageLayout() -> PythonQt.QtGui.QPageLayout

Supplemental documentation: Qt 5 reference:

QPageLayout QPrinter::pageLayout() const

Returns the current page layout. Use this method to access the current QPageSize, QPageLayout::Orientation, QMarginsF, fullPageRect() and paintRect().

Note that you cannot use the setters on the returned object, you must either call the QPrinter methods or setPageLayout().

This function was introduced in Qt 5.3.

See also setPageLayout(), setPageSize(), setPageOrientation(), and setPageMargins().

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#pageLayout

pageOrder

pageOrder() -> Any

X.pageOrder()

Supplemental documentation: Qt 5 reference:

QPrinter::PageOrder QPrinter::pageOrder() const

Returns the current page order.

The default page order is FirstPageFirst.

See also setPageOrder().

Upstream PySide2 reference signatures (binding differences may apply):

pageOrder(self) -> PySide2.QtPrintSupport.QPrinter.PageOrder

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#pageOrder

pageRect

pageRect(arg__1: Any) -> Any

X.pageRect(arg__1) -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

QRectF QPrinter::pageRect(QPrinter::Unit unit) const

Returns the page's rectangle in unit; this is usually smaller than the paperRect() since the page normally has margins between its borders and the paper.

This function was introduced in Qt 4.4.

See also paperSize().

Upstream PySide2 reference signatures (binding differences may apply):

pageRect(self) -> PySide2.QtCore.QRect
pageRect(self, arg__1: PySide2.QtPrintSupport.QPrinter.Unit) -> PySide2.QtCore.QRectF

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#pageRect

pageSize

pageSize() -> Any

X.pageSize()

Upstream PySide2 reference signatures (binding differences may apply):

pageSize(self) -> PySide2.QtGui.QPagedPaintDevice.PageSize

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#pageSize

paintEngine

paintEngine() -> Any

X.paintEngine() -> PythonQt.QtGui.QPaintEngine

Supplemental documentation: Qt 5 reference:

[override virtual] QPaintEngine *QPrinter::paintEngine() const

Reimplements: QPaintDevice::paintEngine() const.

Returns the paint engine used by the printer.

Upstream PySide2 reference signatures (binding differences may apply):

paintEngine(self) -> PySide2.QtGui.QPaintEngine

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#paintEngine

paperName

paperName() -> str

X.paperName() -> str

Upstream PySide2 reference signatures (binding differences may apply):

paperName(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#paperName

paperRect

paperRect(arg__1: Any) -> Any

X.paperRect(arg__1) -> PythonQt.QtCore.QRect

Supplemental documentation: Qt 5 reference:

QRectF QPrinter::paperRect(QPrinter::Unit unit) const

Returns the paper's rectangle in unit; this is usually larger than the pageRect().

This function was introduced in Qt 4.4.

See also pageRect().

Upstream PySide2 reference signatures (binding differences may apply):

paperRect(self) -> PySide2.QtCore.QRect
paperRect(self, arg__1: PySide2.QtPrintSupport.QPrinter.Unit) -> PySide2.QtCore.QRectF

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#paperRect

paperSize

paperSize(unit: Any) -> Any

X.paperSize(unit)

Upstream PySide2 reference signatures (binding differences may apply):

paperSize(self) -> PySide2.QtGui.QPagedPaintDevice.PageSize
paperSize(self, unit: PySide2.QtPrintSupport.QPrinter.Unit) -> PySide2.QtCore.QSizeF

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#paperSize

paperSource

paperSource() -> Any

X.paperSource()

Supplemental documentation: Qt 5 reference:

QPrinter::PaperSource QPrinter::paperSource() const

Returns the printer's paper source. This is Manual or a printer tray or paper cassette.

See also setPaperSource().

Upstream PySide2 reference signatures (binding differences may apply):

paperSource(self) -> PySide2.QtPrintSupport.QPrinter.PaperSource

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#paperSource

printEngine

printEngine() -> Any

X.printEngine() -> PythonQt.QtGui.QPrintEngine

Supplemental documentation: Qt 5 reference:

QPrintEngine *QPrinter::printEngine() const

Returns the print engine used by the printer.

This function was introduced in Qt 4.1.

Upstream PySide2 reference signatures (binding differences may apply):

printEngine(self) -> PySide2.QtPrintSupport.QPrintEngine

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#printEngine

printProgram

printProgram() -> str

X.printProgram() -> str

Supplemental documentation: Qt 5 reference:

QString QPrinter::printProgram() const

Returns the name of the program that sends the print output to the printer.

The default is to return an empty string; meaning that QPrinter will try to be smart in a system-dependent way. On X11 only, you can set it to something different to use a specific print program. On the other platforms, this returns an empty string.

See also setPrintProgram() and setPrinterSelectionOption().

Upstream PySide2 reference signatures (binding differences may apply):

printProgram(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#printProgram

printRange

printRange() -> Any

X.printRange()

Supplemental documentation: Qt 5 reference:

QPrinter::PrintRange QPrinter::printRange() const

Returns the page range of the QPrinter. After the print setup dialog has been opened, this function returns the value selected by the user.

This function was introduced in Qt 4.1.

See also setPrintRange().

Upstream PySide2 reference signatures (binding differences may apply):

printRange(self) -> PySide2.QtPrintSupport.QPrinter.PrintRange

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#printRange

printerName

printerName() -> str

X.printerName() -> str

Supplemental documentation: Qt 5 reference:

QString QPrinter::printerName() const

Returns the printer name. This value is initially set to the name of the default printer.

See also setPrinterName().

Upstream PySide2 reference signatures (binding differences may apply):

printerName(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#printerName

printerState

printerState() -> Any

X.printerState()

Supplemental documentation: Qt 5 reference:

QPrinter::PrinterState QPrinter::printerState() const

Returns the current state of the printer. This may not always be accurate (for example if the printer doesn't have the capability of reporting its state to the operating system).

Upstream PySide2 reference signatures (binding differences may apply):

printerState(self) -> PySide2.QtPrintSupport.QPrinter.PrinterState

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#printerState

resolution

resolution() -> int

X.resolution() -> int

Supplemental documentation: Qt 5 reference:

int QPrinter::resolution() const

Returns the current assumed resolution of the printer, as set by setResolution() or by the printer driver.

See also setResolution().

Upstream PySide2 reference signatures (binding differences may apply):

resolution(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#resolution

setCollateCopies

setCollateCopies(collate: bool) -> None

X.setCollateCopies(collate)

Supplemental documentation: Qt 5 reference:

void QPrinter::setCollateCopies(bool collate)

Sets the default value for collation checkbox when the print dialog appears. If collate is true, it will enable setCollateCopiesEnabled(). The default value is false. This value will be changed by what the user presses in the print dialog.

This function was introduced in Qt 4.1.

See also collateCopies().

Upstream PySide2 reference signatures (binding differences may apply):

setCollateCopies(self, collate: bool) -> None

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setCollateCopies

setColorMode

setColorMode(arg__1: Any) -> None

X.setColorMode(arg__1)

Supplemental documentation: Qt 5 reference:

void QPrinter::setColorMode(QPrinter::ColorMode newColorMode)

Sets the printer's color mode to newColorMode, which can be either Color or GrayScale.

See also colorMode().

Upstream PySide2 reference signatures (binding differences may apply):

setColorMode(self, arg__1: PySide2.QtPrintSupport.QPrinter.ColorMode) -> None

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setColorMode

setCopyCount

setCopyCount(arg__1: int) -> None

X.setCopyCount(arg__1)

Supplemental documentation: Qt 5 reference:

void QPrinter::setCopyCount(int count)

Sets the number of copies to be printed to count.

The printer driver reads this setting and prints the specified number of copies.

This function was introduced in Qt 4.7.

See also copyCount() and supportsMultipleCopies().

Upstream PySide2 reference signatures (binding differences may apply):

setCopyCount(self, arg__1: int) -> None

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setCopyCount

setCreator

setCreator(arg__1: str) -> None

X.setCreator(arg__1)

Supplemental documentation: Qt 5 reference:

void QPrinter::setCreator(const QString \&creator)

Sets the name of the application that created the document to creator.

This function is only applicable to the X11 version of Qt. If no creator name is specified, the creator will be set to "Qt" followed by some version number.

See also creator().

Upstream PySide2 reference signatures (binding differences may apply):

setCreator(self, arg__1: str) -> None

Source: https://doc.qt.io/archives/qt-5.15/qprinter.html#setCreator