En esta página

QPagedPaintDevice Class

La clase QPagedPaintDevice representa un dispositivo de pintura que soporta múltiples páginas. Más...

Cabecera: #include <QPagedPaintDevice>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Hereda: QPaintDevice
Heredado por:

QPdfWriter y QPrinter

Tipos Públicos

enum PdfVersion { PdfVersion_1_4, PdfVersion_A1b, PdfVersion_1_6, PdfVersion_X4 }

Funciones Públicas

virtual ~QPagedPaintDevice()
virtual bool newPage() = 0
QPageLayout pageLayout() const
(since 6.0) QPageRanges pageRanges() const
virtual bool setPageLayout(const QPageLayout &newPageLayout)
virtual bool setPageMargins(const QMarginsF &margins, QPageLayout::Unit units = QPageLayout::Millimeter)
virtual bool setPageOrientation(QPageLayout::Orientation orientation)
(since 6.0) virtual void setPageRanges(const QPageRanges &ranges)
virtual bool setPageSize(const QPageSize &pageSize)

Descripción Detallada

Los dispositivos de pintura paginados se utilizan para generar salidas para impresión o para formatos como PDF. QPdfWriter y QPrinter heredan de él.

Documentación de tipos de miembros

enum QPagedPaintDevice::PdfVersion

El enum PdfVersion describe la versión del archivo PDF producida por QPrinter o QPdfWriter.

ConstanteValorDescripción
QPagedPaintDevice::PdfVersion_1_40Se produce un documento PDF 1.4 compatible.
QPagedPaintDevice::PdfVersion_A1b1Se produce un documento compatible con PDF/A-1b.
QPagedPaintDevice::PdfVersion_1_62Se produce un documento PDF 1.6 compatible. Este valor se añadió en Qt 5.12.
QPagedPaintDevice::PdfVersion_X4 (since Qt 6.8)3Se genera un documento compatible con PDF/X-4.

Documentación de las funciones miembro

[virtual noexcept] QPagedPaintDevice::~QPagedPaintDevice()

Destruye el objeto.

[pure virtual] bool QPagedPaintDevice::newPage()

Inicia una nueva página. Devuelve true en caso de éxito.

QPageLayout QPagedPaintDevice::pageLayout() const

Devuelve el diseño actual de la página. Utilice este método para acceder a QPageSize, QPageLayout::Orientation, QMarginsF, fullRect() y paintRect() actuales.

Tenga en cuenta que no puede utilizar los definidores en el objeto devuelto, debe llamar a los definidores individuales de QPagedPaintDevice o utilizar setPageLayout().

Véase también setPageLayout(), setPageSize(), setPageOrientation() y setPageMargins().

[since 6.0] QPageRanges QPagedPaintDevice::pageRanges() const

Devuelve los intervalos de páginas asociados a este dispositivo.

Esta función se introdujo en Qt 6.0.

Véase también setPageRanges(), QPageRanges, QPrinter::fromPage(), y QPrinter::toPage().

[virtual] bool QPagedPaintDevice::setPageLayout(const QPageLayout &newPageLayout)

Establece el diseño de página en newPageLayout.

Debería llamar a esta función antes de llamar a QPainter::begin(), o inmediatamente antes de llamar a newPage() para aplicar el nuevo diseño de página a una nueva página. No deberías llamar a ningún método de pintura entre una llamada a setPageLayout() y newPage() ya que se podrían utilizar métricas de pintura incorrectas.

Devuelve true si el diseño de página se ha establecido correctamente en newPageLayout.

Véase también pageLayout().

[virtual] bool QPagedPaintDevice::setPageMargins(const QMarginsF &margins, QPageLayout::Unit units = QPageLayout::Millimeter)

Establece la página margins definida en el units dado.

Debería llamar a esta función antes de llamar a QPainter::begin(), o inmediatamente antes de llamar a newPage() para aplicar los nuevos márgenes a una nueva página. No debería llamar a ningún método de pintado entre una llamada a setPageMargins() y newPage() ya que se podría utilizar la métrica de pintado incorrecta.

Para obtener los márgenes de página actuales utilice pageLayout().margins().

Devuelve true si los márgenes de página se han establecido correctamente en margins.

Véase también pageLayout().

[virtual] bool QPagedPaintDevice::setPageOrientation(QPageLayout::Orientation orientation)

Establece la página orientation.

La orientación de la página se utiliza para definir la orientación del tamaño de la página cuando se obtiene el rectángulo de página.

Debería llamar a esta función antes de llamar a QPainter::begin(), o inmediatamente antes de llamar a newPage() para aplicar la nueva orientación a una nueva página. No debería llamar a ningún método de pintado entre una llamada a setPageOrientation() y newPage() ya que se podría utilizar la métrica de pintado incorrecta.

Para obtener la QPageLayout::Orientation actual utilice pageLayout().orientation().

Devuelve true si la orientación de la página se ha establecido correctamente en orientation.

Véase también pageLayout().

[virtual, since 6.0] void QPagedPaintDevice::setPageRanges(const QPageRanges &ranges)

Establece los intervalos de páginas para este dispositivo en ranges.

Esta función se introdujo en Qt 6.0.

Véase también pageRanges().

[virtual] bool QPagedPaintDevice::setPageSize(const QPageSize &pageSize)

Establece el tamaño de página en pageSize.

Para obtener el QPageSize actual utilice pageLayout().pageSize().

Debería llamar a esta función antes de llamar a QPainter::begin(), o inmediatamente antes de llamar a newPage() para aplicar el nuevo tamaño de página a una nueva página. No debería llamar a ningún método de pintado entre una llamada a setPageSize() y newPage() ya que podrían utilizarse métricas de pintado incorrectas.

Devuelve true si el tamaño de página se ha establecido correctamente en pageSize.

Véase también pageLayout().

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.