QPageLayout Class
Describes the size, orientation and margins of a page. More...
| Header: | #include <QPageLayout> |
| qmake: | QT += gui |
| Since: | Qt 5.3 |
This class was introduced in Qt 5.3.
Public Types
| enum | Mode { StandardMode, FullPageMode } |
| enum | Orientation { Portrait, Landscape } |
| enum | Unit { Millimeter, Point, Inch, Pica, Didot, Cicero } |
Detailed Description
The QPageLayout class defines the layout of a page in a paged document, with the page size, orientation and margins able to be set and the full page and paintable page rectangles defined by those attributes able to be queried in a variety of units.
The page size is defined by the QPageSize class which can be queried for page size attributes. Note that the QPageSize itself is always defined in a Portrait orientation.
The minimum margins can be defined for the layout but normally default to 0. When used in conjunction with Qt's printing support the minimum margins will reflect the minimum printable area defined by the printer.
In the default StandardMode the current margins and minimum margins are always taken into account. The paintable rectangle is the full page rectangle less the current margins, and the current margins can only be set to values between the minimum margins and the maximum margins allowed by the full page size.
In FullPageMode the current margins and minimum margins are not taken into account. The paintable rectangle is the full page rectangle, and the current margins can be set to any values regardless of the minimum margins and page size.
See also QPageSize.
Member Type Documentation
enum QPageLayout::Mode
Defines the page layout mode
| Constant | Value | Description |
|---|---|---|
QPageLayout::StandardMode | 0 | Paint Rect includes margins, margins must fall between the minimum and maximum. |
QPageLayout::FullPageMode | 1 | Paint Rect excludes margins, margins can be any value and must be managed manually. |
enum QPageLayout::Orientation
This enum type defines the page orientation
| Constant | Value | Description |
|---|---|---|
QPageLayout::Portrait | 0 | The page size is used in its default orientation |
QPageLayout::Landscape | 1 | The page size is rotated through 90 degrees |
Note that some standard page sizes are defined with a width larger than their height, hence the orientation is defined relative to the standard page size and not using the relative page dimensions.
enum QPageLayout::Unit
This enum type is used to specify the measurement unit for page layout and margins.
| Constant | Value | Description |
|---|---|---|
QPageLayout::Millimeter | 0 | |
QPageLayout::Point | 1 | 1/72th of an inch |
QPageLayout::Inch | 2 | |
QPageLayout::Pica | 3 | 1/72th of a foot, 1/6th of an inch, 12 Points |
QPageLayout::Didot | 4 | 1/72th of a French inch, 0.375 mm |
QPageLayout::Cicero | 5 | 1/6th of a French inch, 12 Didot, 4.5mm |