CopperSpice API
1.9.2
|
Represents a paint device which supports multiple pages. More...
Public Methods | |
QPagedPaintDevice () | |
~QPagedPaintDevice () | |
QMarginsF | margins () const |
virtual bool | newPage () = 0 |
virtual QPageLayout | pageLayout () const |
QPageSize::PageSizeId | pageSize () const |
QSizeF | pageSizeMM () const |
virtual void | setMargins (const QMarginsF &margins) |
virtual bool | setPageLayout (const QPageLayout &pageLayout) |
virtual bool | setPageMargins (const QMarginsF &margins) |
virtual bool | setPageMargins (const QMarginsF &margins, QPageLayout::Unit units) |
virtual bool | setPageOrientation (QPageLayout::Orientation orientation) |
virtual bool | setPageSize (const QPageSize &size) |
virtual void | setPageSize (QPageSize::PageSizeId sizeId) |
virtual void | setPageSizeMM (const QSizeF &size) |
Public Methods inherited from QPaintDevice | |
virtual | ~QPaintDevice () |
int | colorCount () const |
int | depth () const |
int | devicePixelRatio () const |
qreal | devicePixelRatioF () const |
int | height () const |
int | heightMM () const |
int | logicalDpiX () const |
int | logicalDpiY () const |
virtual QPaintEngine * | paintEngine () const = 0 |
bool | paintingActive () const |
int | physicalDpiX () const |
int | physicalDpiY () const |
int | width () const |
int | widthMM () const |
Additional Inherited Members | |
Public Types inherited from QPaintDevice | |
enum | PaintDeviceMetric |
Protected Methods inherited from QPaintDevice | |
QPaintDevice () | |
virtual int | metric (PaintDeviceMetric metric) const |
The QPagedPaintDevice class represents a paintdevice that supports multiple pages. Paged paint devices are used to generate output for printing or for formats like PDF. QPdfWriter and QPrinter inherit from this class.
QPagedPaintDevice::QPagedPaintDevice | ( | ) |
Constructs a new QPagedPaintDevice.
QPagedPaintDevice::~QPagedPaintDevice | ( | ) |
Deletes the current object.
QMarginsF QPagedPaintDevice::margins | ( | ) | const |
Returns the current margins of the paint device. The default is 0.
Margins are specified in millimeters.
|
pure virtual |
Starts a new page. Returns true on success.
Implemented in QPrinter::newPage(), QPdfWriter::newPage()
|
virtual |
Returns the current page layout.
Use this method to access the current QPageSize, QMarginsF, QPageLayout::Orientation, QPageLayout::fullRect(), and QPageLayout::paintRect().
Since the return value is a copy of the current page layout, modifying properties will not affect the paint device. To change the print settings use methods like QPdfWriter::setPageMargins() or QPdfWriter::setPageLayout().
Reimplemented in QPrinter::pageLayout(), QPdfWriter::pageLayout()
QPageSize::PageSizeId QPagedPaintDevice::pageSize | ( | ) | const |
Returns the currently used page size as an enum.
QSizeF QPagedPaintDevice::pageSizeMM | ( | ) | const |
Returns the page size in millimeters.
|
virtual |
Sets the page margins using margins. Margins are specified in millimeters. The margins are a hint to drawing methods and do not affect the coordinate system or clipping.
Reimplemented in QPrinter::setMargins(), QPdfWriter::setMargins()
|
virtual |
Sets the page layout to pageLayout. Returns true if the page layout was successfully set to newPageLayout.
You should call this method 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.
Reimplemented in QPrinter::setPageLayout(), QPdfWriter::setPageLayout()
|
virtual |
Sets the page margins in the current page layout units. Returns true if the page margins was successfully set to margins.
You should call this method 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 QPageLayout::pageMargins().
Reimplemented in QPrinter::setPageMargins(), QPdfWriter::setPageMargins()
|
virtual |
Sets the page margins defined in the given units. Returns true if the page margins were successfully set to margins.
You should call this method 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 QPageLayout::margins().
Reimplemented in QPrinter::setPageMargins(), QPdfWriter::setPageMargins()
|
virtual |
Sets the page orientation. Returns true if the page orientation was successfully set to orientation.
The page orientation is used to define the orientation of the page size when obtaining the page rect.
You should call this method 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 QPageLayout::orientation().
Reimplemented in QPrinter::setPageOrientation(), QPdfWriter::setPageOrientation()
|
virtual |
Sets the page size to size. To get the current QPageSize use QPageLayout::pageSize(). Returns true if the page size was successfully set to pageSize.
You should call this method 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.
Reimplemented in QPdfWriter::setPageSize(), QPrinter::setPageSize()
|
virtual |
Sets the page size using the page size enum value of sizeId.
Reimplemented in QPrinter::setPageSize(), QPdfWriter::setPageSize()
|
virtual |
Sets the page size to size. size is specified in millimeters. If the size matches a standard QPageSize::PageSizeId then the page size will be used, otherwise the enum value of QPageSize::Custom will be set.
Reimplemented in QPrinter::setPageSizeMM(), QPdfWriter::setPageSizeMM()