21 #include <QStringList> 52 return QPointF( mX, mY );
62 QStringList parts =
string.split(
',' );
63 if ( parts.count() != 3 )
77 return ( !
operator==( other ) );
QString encodePoint() const
Encodes the layout point to a string.
QgsLayoutPoint operator/(double v) const
Divides the x and y by a scalar value.
QgsLayoutPoint operator*(double v) const
Multiplies the x and y by a scalar value.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
bool isNull() const
Tests whether the position is null, ie both its x and y coordinates are zero.
bool operator==(const QgsLayoutPoint &other) const
This class provides a method of storing points, consisting of an x and y coordinate, for use in QGIS layouts.
QgsUnitTypes::LayoutUnit units() const
Returns the units for the point.
static Q_INVOKABLE QgsUnitTypes::LayoutUnit decodeLayoutUnit(const QString &string, bool *ok=nullptr)
Decodes a layout unit from a string.
double y() const
Returns y coordinate of point.
double x() const
Returns x coordinate of point.
bool operator!=(const QgsLayoutPoint &other) const
QgsLayoutPoint operator/=(double v)
Divides the x and y by a scalar value.
QPointF toQPointF() const
Converts the layout point to a QPointF.
QgsLayoutPoint(double x, double y, QgsUnitTypes::LayoutUnit units=QgsUnitTypes::LayoutMillimeters)
Constructor for QgsLayoutPoint.
static Q_INVOKABLE QString encodeUnit(QgsUnitTypes::DistanceUnit unit)
Encodes a distance unit to a string.
QgsLayoutPoint operator*=(double v)
Multiplies the x and y by a scalar value.
LayoutUnit
Layout measurement units.
static QgsLayoutPoint decodePoint(const QString &string)
Decodes a point from a string.