QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
This class provides a method of storing points, consisting of an x and y coordinate, for use in QGIS layouts. Measurement units are stored alongside the position. More...
#include <qgslayoutpoint.h>
Public Member Functions | |
QgsLayoutPoint (double x, double y, QgsUnitTypes::LayoutUnit units=QgsUnitTypes::LayoutMillimeters) | |
Constructor for QgsLayoutPoint. More... | |
QgsLayoutPoint (QgsUnitTypes::LayoutUnit units=QgsUnitTypes::LayoutMillimeters) | |
Constructor for an empty point, where both x and y are set to 0. More... | |
QgsLayoutPoint (QPointF point, QgsUnitTypes::LayoutUnit units=QgsUnitTypes::LayoutMillimeters) | |
Constructor for QgsLayoutPoint. More... | |
QString | encodePoint () const |
Encodes the layout point to a string. More... | |
bool | isNull () const |
Tests whether the position is null, ie both its x and y coordinates are zero. More... | |
bool | operator!= (const QgsLayoutPoint &other) const |
QgsLayoutPoint | operator* (double v) const |
Multiplies the x and y by a scalar value. More... | |
QgsLayoutPoint | operator*= (double v) |
Multiplies the x and y by a scalar value. More... | |
QgsLayoutPoint | operator/ (double v) const |
Divides the x and y by a scalar value. More... | |
QgsLayoutPoint | operator/= (double v) |
Divides the x and y by a scalar value. More... | |
bool | operator== (const QgsLayoutPoint &other) const |
void | setPoint (const double x, const double y) |
Sets new x and y coordinates for the point. More... | |
void | setUnits (const QgsUnitTypes::LayoutUnit units) |
Sets the units for the point. More... | |
void | setX (const double x) |
Sets the x coordinate of point. More... | |
void | setY (const double y) |
Sets y coordinate of point. More... | |
QPointF | toQPointF () const |
Converts the layout point to a QPointF. More... | |
QgsUnitTypes::LayoutUnit | units () const |
Returns the units for the point. More... | |
double | x () const |
Returns x coordinate of point. More... | |
double | y () const |
Returns y coordinate of point. More... | |
Static Public Member Functions | |
static QgsLayoutPoint | decodePoint (const QString &string) |
Decodes a point from a string. More... | |
This class provides a method of storing points, consisting of an x and y coordinate, for use in QGIS layouts. Measurement units are stored alongside the position.
Definition at line 39 of file qgslayoutpoint.h.
QgsLayoutPoint::QgsLayoutPoint | ( | double | x, |
double | y, | ||
QgsUnitTypes::LayoutUnit | units = QgsUnitTypes::LayoutMillimeters |
||
) |
Constructor for QgsLayoutPoint.
Definition at line 23 of file qgslayoutpoint.cpp.
|
explicit |
Constructor for QgsLayoutPoint.
Definition at line 31 of file qgslayoutpoint.cpp.
|
explicit |
Constructor for an empty point, where both x and y are set to 0.
units | units for measurement |
Definition at line 39 of file qgslayoutpoint.cpp.
|
static |
Decodes a point from a string.
Definition at line 60 of file qgslayoutpoint.cpp.
QString QgsLayoutPoint::encodePoint | ( | ) | const |
Encodes the layout point to a string.
Definition at line 55 of file qgslayoutpoint.cpp.
bool QgsLayoutPoint::isNull | ( | ) | const |
Tests whether the position is null, ie both its x and y coordinates are zero.
true
if point is null Definition at line 45 of file qgslayoutpoint.cpp.
bool QgsLayoutPoint::operator!= | ( | const QgsLayoutPoint & | other | ) | const |
Definition at line 75 of file qgslayoutpoint.cpp.
QgsLayoutPoint QgsLayoutPoint::operator* | ( | double | v | ) | const |
Multiplies the x and y by a scalar value.
Definition at line 80 of file qgslayoutpoint.cpp.
QgsLayoutPoint QgsLayoutPoint::operator*= | ( | double | v | ) |
Multiplies the x and y by a scalar value.
Definition at line 85 of file qgslayoutpoint.cpp.
QgsLayoutPoint QgsLayoutPoint::operator/ | ( | double | v | ) | const |
Divides the x and y by a scalar value.
Definition at line 91 of file qgslayoutpoint.cpp.
QgsLayoutPoint QgsLayoutPoint::operator/= | ( | double | v | ) |
Divides the x and y by a scalar value.
Definition at line 96 of file qgslayoutpoint.cpp.
bool QgsLayoutPoint::operator== | ( | const QgsLayoutPoint & | other | ) | const |
Definition at line 70 of file qgslayoutpoint.cpp.
|
inline |
Sets new x and y coordinates for the point.
Definition at line 65 of file qgslayoutpoint.h.
|
inline |
Sets the units for the point.
Does not alter the stored coordinates, ie. no conversion is done.
Definition at line 106 of file qgslayoutpoint.h.
|
inline |
|
inline |
QPointF QgsLayoutPoint::toQPointF | ( | ) | const |
Converts the layout point to a QPointF.
The unit information is discarded during this operation.
Definition at line 50 of file qgslayoutpoint.cpp.
|
inline |
|
inline |
|
inline |