QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
18 #ifndef QGSLAYOUTSIZE_H
19 #define QGSLAYOUTSIZE_H
21 #include "qgis_core.h"
69 void setSize(
const double width,
const double height ) { mWidth = width; mHeight = height; }
76 double width()
const {
return mWidth; }
83 void setWidth(
const double width ) { mWidth = width; }
90 double height()
const {
return mHeight; }
97 void setHeight(
const double height ) { mHeight = height; }
117 bool isEmpty()
const;
124 QSizeF toQSizeF()
const;
130 QString encodeSize()
const;
162 SIP_PYOBJECT __repr__();
164 QString str = QStringLiteral(
"<QgsLayoutSize: %1 x %2 %3 >" ).arg( sipCpp->width() ).arg( sipCpp->height() ).arg(
QgsUnitTypes::toAbbreviatedString( sipCpp->units() ) );
165 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
172 double mHeight = 0.0;
177 #endif // QGSLAYOUTSIZE_H
double width() const
Returns the width of the size.
QgsUnitTypes::LayoutUnit units() const
Returns the units for the size.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
static Q_INVOKABLE QString toAbbreviatedString(QgsUnitTypes::DistanceUnit unit)
Returns a translated abbreviation representing a distance unit.
LayoutUnit
Layout measurement units.
QgsMargins operator/(const QgsMargins &margins, double divisor)
Returns a QgsMargins object that is formed by dividing the components of the given margins by the giv...
void setHeight(const double height)
Sets the height for the size.
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
QgsMargins operator*(const QgsMargins &margins, double factor)
Returns a QgsMargins object that is formed by multiplying each component of the given margins by fact...
double height() const
Returns the height of the size.
void setSize(const double width, const double height)
Sets new width and height for the size.
void setWidth(const double width)
Sets the width for the size.
This class provides a method of storing sizes, consisting of a width and height, for use in QGIS layo...
@ LayoutMillimeters
Millimeters.
void setUnits(const QgsUnitTypes::LayoutUnit units)
Sets the units for the size.