|
QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
|
This class provides a method of storing sizes, consisting of a width and height, for use in QGIS layouts. More...
#include <qgslayoutsize.h>
Public Member Functions | |
| QgsLayoutSize (double width, double height, Qgis::LayoutUnit units=Qgis::LayoutUnit::Millimeters) | |
| Constructor for QgsLayoutSize. | |
| QgsLayoutSize (Qgis::LayoutUnit units=Qgis::LayoutUnit::Millimeters) | |
| Constructor for an empty layout size. | |
| QgsLayoutSize (QSizeF size, Qgis::LayoutUnit units=Qgis::LayoutUnit::Millimeters) | |
| Constructor for QgsLayoutSize. | |
| QString | encodeSize () const |
| Encodes the layout size to a string. | |
| double | height () const |
| Returns the height of the size. | |
| bool | isEmpty () const |
| Tests whether the size is empty, ie both its width and height are zero. | |
| bool | operator!= (const QgsLayoutSize &other) const |
| QgsLayoutSize | operator* (double v) const |
| Multiplies the width and height by a scalar value. | |
| QgsLayoutSize | operator*= (double v) |
| Multiplies the width and height by a scalar value. | |
| QgsLayoutSize | operator/ (double v) const |
| Divides the width and height by a scalar value. | |
| QgsLayoutSize | operator/= (double v) |
| Divides the width and height by a scalar value. | |
| bool | operator== (const QgsLayoutSize &other) const |
| void | setHeight (const double height) |
| Sets the height for the size. | |
| void | setSize (const double width, const double height) |
| Sets new width and height for the size. | |
| void | setUnits (const Qgis::LayoutUnit units) |
| Sets the units for the size. | |
| void | setWidth (const double width) |
| Sets the width for the size. | |
| QSizeF | toQSizeF () const |
| Converts the layout size to a QSizeF. | |
| Qgis::LayoutUnit | units () const |
| Returns the units for the size. | |
| double | width () const |
| Returns the width of the size. | |
Static Public Member Functions | |
| static QgsLayoutSize | decodeSize (const QString &string) |
| Decodes a size from a string. | |
This class provides a method of storing sizes, consisting of a width and height, for use in QGIS layouts.
Measurement units are stored alongside the size.
Definition at line 39 of file qgslayoutsize.h.
| QgsLayoutSize::QgsLayoutSize | ( | double | width, |
| double | height, | ||
| Qgis::LayoutUnit | units = Qgis::LayoutUnit::Millimeters |
||
| ) |
Constructor for QgsLayoutSize.
| width | width |
| height | height |
| units | units for width and height |
Definition at line 23 of file qgslayoutsize.cpp.
|
explicit |
Constructor for QgsLayoutSize.
Definition at line 30 of file qgslayoutsize.cpp.
|
explicit |
Constructor for an empty layout size.
| units | units for measurement |
Definition at line 37 of file qgslayoutsize.cpp.
|
static |
| QString QgsLayoutSize::encodeSize | ( | ) | const |
Encodes the layout size to a string.
Definition at line 53 of file qgslayoutsize.cpp.
|
inline |
Returns the height of the size.
Definition at line 89 of file qgslayoutsize.h.
| bool QgsLayoutSize::isEmpty | ( | ) | const |
Tests whether the size is empty, ie both its width and height are zero.
true if size is empty Definition at line 43 of file qgslayoutsize.cpp.
| bool QgsLayoutSize::operator!= | ( | const QgsLayoutSize & | other | ) | const |
Definition at line 74 of file qgslayoutsize.cpp.
| QgsLayoutSize QgsLayoutSize::operator* | ( | double | v | ) | const |
Multiplies the width and height by a scalar value.
Definition at line 79 of file qgslayoutsize.cpp.
| QgsLayoutSize QgsLayoutSize::operator*= | ( | double | v | ) |
Multiplies the width and height by a scalar value.
Definition at line 84 of file qgslayoutsize.cpp.
| QgsLayoutSize QgsLayoutSize::operator/ | ( | double | v | ) | const |
Divides the width and height by a scalar value.
Definition at line 90 of file qgslayoutsize.cpp.
| QgsLayoutSize QgsLayoutSize::operator/= | ( | double | v | ) |
Divides the width and height by a scalar value.
Definition at line 95 of file qgslayoutsize.cpp.
| bool QgsLayoutSize::operator== | ( | const QgsLayoutSize & | other | ) | const |
Definition at line 69 of file qgslayoutsize.cpp.
|
inline |
Sets the height for the size.
Definition at line 96 of file qgslayoutsize.h.
|
inline |
Sets new width and height for the size.
Definition at line 68 of file qgslayoutsize.h.
|
inline |
Sets the units for the size.
Does not alter the stored width or height, ie. no conversion is done.
Definition at line 109 of file qgslayoutsize.h.
|
inline |
Sets the width for the size.
Definition at line 82 of file qgslayoutsize.h.
| QSizeF QgsLayoutSize::toQSizeF | ( | ) | const |
Converts the layout size to a QSizeF.
The unit information is discarded during this operation.
Definition at line 48 of file qgslayoutsize.cpp.
|
inline |
|
inline |
Returns the width of the size.
Definition at line 75 of file qgslayoutsize.h.