QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
|
This class provides a method of storing points, consisting of an x and y coordinate, for use in QGIS layouts. More...
#include <qgslayoutpoint.h>
Public Member Functions | |
QgsLayoutPoint (double x, double y, Qgis::LayoutUnit units=Qgis::LayoutUnit::Millimeters) | |
Constructor for QgsLayoutPoint. | |
QgsLayoutPoint (Qgis::LayoutUnit units=Qgis::LayoutUnit::Millimeters) | |
Constructor for an empty point, where both x and y are set to 0. | |
QgsLayoutPoint (QPointF point, Qgis::LayoutUnit units=Qgis::LayoutUnit::Millimeters) | |
Constructor for QgsLayoutPoint. | |
QString | encodePoint () const |
Encodes the layout point to a string. | |
bool | isNull () const |
Tests whether the position is null, ie both its x and y coordinates are zero. | |
bool | operator!= (const QgsLayoutPoint &other) const |
QgsLayoutPoint | operator* (double v) const |
Multiplies the x and y by a scalar value. | |
QgsLayoutPoint | operator*= (double v) |
Multiplies the x and y by a scalar value. | |
QgsLayoutPoint | operator/ (double v) const |
Divides the x and y by a scalar value. | |
QgsLayoutPoint | operator/= (double v) |
Divides the x and y by a scalar value. | |
bool | operator== (const QgsLayoutPoint &other) const |
void | setPoint (const double x, const double y) |
Sets new x and y coordinates for the point. | |
void | setUnits (const Qgis::LayoutUnit units) |
Sets the units for the point. | |
void | setX (const double x) |
Sets the x coordinate of point. | |
void | setY (const double y) |
Sets y coordinate of point. | |
QPointF | toQPointF () const |
Converts the layout point to a QPointF. | |
Qgis::LayoutUnit | units () const |
Returns the units for the point. | |
double | x () const |
Returns x coordinate of point. | |
double | y () const |
Returns y coordinate of point. | |
Static Public Member Functions | |
static QgsLayoutPoint | decodePoint (const QString &string) |
Decodes a point from a string. | |
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 38 of file qgslayoutpoint.h.
QgsLayoutPoint::QgsLayoutPoint | ( | double | x, |
double | y, | ||
Qgis::LayoutUnit | units = Qgis::LayoutUnit::Millimeters |
||
) |
Constructor for QgsLayoutPoint.
Definition at line 24 of file qgslayoutpoint.cpp.
|
explicit |
Constructor for QgsLayoutPoint.
Definition at line 32 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 40 of file qgslayoutpoint.cpp.
|
static |
Decodes a point from a string.
Definition at line 61 of file qgslayoutpoint.cpp.
QString QgsLayoutPoint::encodePoint | ( | ) | const |
Encodes the layout point to a string.
Definition at line 56 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 46 of file qgslayoutpoint.cpp.
bool QgsLayoutPoint::operator!= | ( | const QgsLayoutPoint & | other | ) | const |
Definition at line 76 of file qgslayoutpoint.cpp.
QgsLayoutPoint QgsLayoutPoint::operator* | ( | double | v | ) | const |
Multiplies the x and y by a scalar value.
Definition at line 81 of file qgslayoutpoint.cpp.
QgsLayoutPoint QgsLayoutPoint::operator*= | ( | double | v | ) |
Multiplies the x and y by a scalar value.
Definition at line 86 of file qgslayoutpoint.cpp.
QgsLayoutPoint QgsLayoutPoint::operator/ | ( | double | v | ) | const |
Divides the x and y by a scalar value.
Definition at line 92 of file qgslayoutpoint.cpp.
QgsLayoutPoint QgsLayoutPoint::operator/= | ( | double | v | ) |
Divides the x and y by a scalar value.
Definition at line 97 of file qgslayoutpoint.cpp.
bool QgsLayoutPoint::operator== | ( | const QgsLayoutPoint & | other | ) | const |
Definition at line 71 of file qgslayoutpoint.cpp.
|
inline |
Sets new x and y coordinates for the point.
Definition at line 64 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 105 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 51 of file qgslayoutpoint.cpp.
|
inline |
|
inline |
|
inline |