30 Q_ASSERT_X( !std::isnan( mX ) && !std::isnan( mY ),
"QgsLayoutPoint",
"Layout point with NaN coordinates created" );
55 return QPointF( mX, mY );
65 QStringList parts =
string.split(
',' );
66 if ( parts.count() != 3 )
70 const double x = parts[0].toDouble();
71 const double y = parts[1].toDouble();
76 if ( std::isnan(
x ) || std::isnan(
y ) ||
x > 9.99998e+06 ||
y > 9.99998e+06 )
89 return ( !
operator==( other ) );
LayoutUnit
Layout measurement units.
This class provides a method of storing points, consisting of an x and y coordinate,...
QgsLayoutPoint operator/=(double v)
Divides the x and y by a scalar value.
double x() const
Returns x coordinate of point.
QPointF toQPointF() const
Converts the layout point to a QPointF.
QString encodePoint() const
Encodes the layout point to a string.
QgsLayoutPoint operator/(double v) const
Divides the x and y by a scalar value.
static QgsLayoutPoint decodePoint(const QString &string)
Decodes a point from a string.
bool isNull() const
Tests whether the position is null, ie both its x and y coordinates are zero.
double y() const
Returns y coordinate of point.
QgsLayoutPoint(double x, double y, Qgis::LayoutUnit units=Qgis::LayoutUnit::Millimeters)
Constructor for QgsLayoutPoint.
QgsLayoutPoint operator*=(double v)
Multiplies the x and y by a scalar value.
bool operator==(const QgsLayoutPoint &other) const
Qgis::LayoutUnit units() const
Returns the units for the point.
bool operator!=(const QgsLayoutPoint &other) const
QgsLayoutPoint operator*(double v) const
Multiplies the x and y by a scalar value.
static Q_INVOKABLE Qgis::LayoutUnit decodeLayoutUnit(const QString &string, bool *ok=nullptr)
Decodes a layout unit from a string.
static Q_INVOKABLE QString encodeUnit(Qgis::DistanceUnit unit)
Encodes a distance unit to a string.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)