IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QPagedPaintDevice Class

The QPagedPaintDevice class represents a paint device that supports multiple pages.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QPagedPaintDevice Class

  • Header: QPagedPaintDevice

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Gui)

    target_link_libraries(mytarget PRIVATE Qt6::Gui)

  • qmake: QT += gui

  • Inherits: QPaintDevice

  • Inherited By: QPdfWriter and QPrinter

  • Group: QPagedPaintDevice is part of Painting Classes

Detailed Description

Paged paint devices are used to generate output for printing or for formats like PDF. QPdfWriter and QPrinter inherit from it.

Member Type Documentation

 

enum QPagedPaintDevice::PdfVersion

The PdfVersion enum describes the version of the PDF file that is produced by QPrinter or QPdfWriter.

Constant

Value

Description

QPagedPaintDevice::PdfVersion_1_4

0

A PDF 1.4 compatible document is produced.

QPagedPaintDevice::PdfVersion_A1b

1

A PDF/A-1b compatible document is produced.

QPagedPaintDevice::PdfVersion_1_6

2

A PDF 1.6 compatible document is produced. This value was added in Qt 5.12.

Member Function Documentation

 

[virtual] QPagedPaintDevice::~QPagedPaintDevice()

Destroys the object.

[pure virtual] bool QPagedPaintDevice::newPage()

Starts a new page. Returns true on success.

[since 5.3] QPageLayout QPagedPaintDevice::pageLayout() const

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

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

This function was introduced in Qt 5.3.

See Also

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

Returns the page ranges associated with this device.

This function was introduced in Qt 6.0.

See Also

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

Sets the page layout to newPageLayout.

You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new page layout to a new page. You should not call any painting methods between a call to setPageLayout() and newPage() as the wrong paint metrics may be used.

Returns true if the page layout was successfully set to newPageLayout.

This function was introduced in Qt 5.3.

See Also

See also pageLayout()

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

Set the page margins defined in the given units.

You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new margins to a new page. You should not call any painting methods between a call to setPageMargins() and newPage() as the wrong paint metrics may be used.

To get the current page margins use pageLayout().margins().

Returns true if the page margins were successfully set to margins.

This function was introduced in Qt 5.3.

See Also

See also pageLayout()

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

Sets the page orientation.

The page orientation is used to define the orientation of the page size when obtaining the page rect.

You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new orientation to a new page. You should not call any painting methods between a call to setPageOrientation() and newPage() as the wrong paint metrics may be used.

To get the current QPageLayout::Orientation use pageLayout().orientation().

Returns true if the page orientation was successfully set to orientation.

This function was introduced in Qt 5.3.

See Also

See also pageLayout()

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

Sets the page ranges for this device to ranges.

This function was introduced in Qt 6.0.

See Also

See also pageRanges()

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

Sets the page size to pageSize.

To get the current QPageSize use pageLayout().pageSize().

You should call this before calling QPainter::begin(), or immediately before calling newPage() to apply the new page size to a new page. You should not call any painting methods between a call to setPageSize() and newPage() as the wrong paint metrics may be used.

Returns true if the page size was successfully set to pageSize.

This function was introduced in Qt 5.3.

See Also

See also pageLayout()

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+