QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
QgsLayoutMeasurement Class Reference

This class provides a method of storing measurements for use in QGIS layouts using a variety of different measurement units. More...

#include <qgslayoutmeasurement.h>

Public Member Functions

 QgsLayoutMeasurement (double length, Qgis::LayoutUnit units=Qgis::LayoutUnit::Millimeters)
 Constructor for QgsLayoutMeasurement.
 
QString encodeMeasurement () const
 Encodes the layout measurement to a string.
 
double length () const
 Returns the length of the measurement.
 
bool operator!= (QgsLayoutMeasurement other) const
 
QgsLayoutMeasurement operator* (double v) const
 Multiplies the measurement by a scalar value.
 
QgsLayoutMeasurement operator*= (double v)
 Multiplies the measurement by a scalar value.
 
QgsLayoutMeasurement operator+ (double v) const
 Adds a scalar value to the measurement.
 
QgsLayoutMeasurement operator+= (double v)
 Adds a scalar value to the measurement.
 
QgsLayoutMeasurement operator- (double v) const
 Subtracts a scalar value from the measurement.
 
QgsLayoutMeasurement operator-= (double v)
 Subtracts a scalar value from the measurement.
 
QgsLayoutMeasurement operator/ (double v) const
 Divides the measurement by a scalar value.
 
QgsLayoutMeasurement operator/= (double v)
 Divides the measurement by a scalar value.
 
bool operator== (QgsLayoutMeasurement other) const
 
void setLength (const double length)
 Sets the length of the measurement.
 
void setUnits (const Qgis::LayoutUnit units)
 Sets the units for the measurement.
 
Qgis::LayoutUnit units () const
 Returns the units for the measurement.
 

Static Public Member Functions

static QgsLayoutMeasurement decodeMeasurement (const QString &string)
 Decodes a measurement from a string.
 

Detailed Description

This class provides a method of storing measurements for use in QGIS layouts using a variety of different measurement units.

See also
QgsLayoutMeasurementConverter

Definition at line 32 of file qgslayoutmeasurement.h.

Constructor & Destructor Documentation

◆ QgsLayoutMeasurement()

QgsLayoutMeasurement::QgsLayoutMeasurement ( double  length,
Qgis::LayoutUnit  units = Qgis::LayoutUnit::Millimeters 
)
explicit

Constructor for QgsLayoutMeasurement.

Parameters
lengthmeasurement length
unitsmeasurement units

Definition at line 24 of file qgslayoutmeasurement.cpp.

Member Function Documentation

◆ decodeMeasurement()

QgsLayoutMeasurement QgsLayoutMeasurement::decodeMeasurement ( const QString &  string)
static

Decodes a measurement from a string.

See also
encodeMeasurement()

Definition at line 35 of file qgslayoutmeasurement.cpp.

◆ encodeMeasurement()

QString QgsLayoutMeasurement::encodeMeasurement ( ) const

Encodes the layout measurement to a string.

See also
decodeMeasurement()

Definition at line 30 of file qgslayoutmeasurement.cpp.

◆ length()

double QgsLayoutMeasurement::length ( ) const
inline

Returns the length of the measurement.

See also
setLength()

Definition at line 47 of file qgslayoutmeasurement.h.

◆ operator!=()

bool QgsLayoutMeasurement::operator!= ( QgsLayoutMeasurement  other) const

Definition at line 50 of file qgslayoutmeasurement.cpp.

◆ operator*()

QgsLayoutMeasurement QgsLayoutMeasurement::operator* ( double  v) const

Multiplies the measurement by a scalar value.

Definition at line 77 of file qgslayoutmeasurement.cpp.

◆ operator*=()

QgsLayoutMeasurement QgsLayoutMeasurement::operator*= ( double  v)

Multiplies the measurement by a scalar value.

Definition at line 82 of file qgslayoutmeasurement.cpp.

◆ operator+()

QgsLayoutMeasurement QgsLayoutMeasurement::operator+ ( double  v) const

Adds a scalar value to the measurement.

Definition at line 55 of file qgslayoutmeasurement.cpp.

◆ operator+=()

QgsLayoutMeasurement QgsLayoutMeasurement::operator+= ( double  v)

Adds a scalar value to the measurement.

Definition at line 60 of file qgslayoutmeasurement.cpp.

◆ operator-()

QgsLayoutMeasurement QgsLayoutMeasurement::operator- ( double  v) const

Subtracts a scalar value from the measurement.

Definition at line 66 of file qgslayoutmeasurement.cpp.

◆ operator-=()

QgsLayoutMeasurement QgsLayoutMeasurement::operator-= ( double  v)

Subtracts a scalar value from the measurement.

Definition at line 71 of file qgslayoutmeasurement.cpp.

◆ operator/()

QgsLayoutMeasurement QgsLayoutMeasurement::operator/ ( double  v) const

Divides the measurement by a scalar value.

Definition at line 88 of file qgslayoutmeasurement.cpp.

◆ operator/=()

QgsLayoutMeasurement QgsLayoutMeasurement::operator/= ( double  v)

Divides the measurement by a scalar value.

Definition at line 93 of file qgslayoutmeasurement.cpp.

◆ operator==()

bool QgsLayoutMeasurement::operator== ( QgsLayoutMeasurement  other) const

Definition at line 45 of file qgslayoutmeasurement.cpp.

◆ setLength()

void QgsLayoutMeasurement::setLength ( const double  length)
inline

Sets the length of the measurement.

See also
length()

Definition at line 53 of file qgslayoutmeasurement.h.

◆ setUnits()

void QgsLayoutMeasurement::setUnits ( const Qgis::LayoutUnit  units)
inline

Sets the units for the measurement.

Does not alter the stored length, ie. no length conversion is done.

See also
units()

Definition at line 66 of file qgslayoutmeasurement.h.

◆ units()

Qgis::LayoutUnit QgsLayoutMeasurement::units ( ) const
inline

Returns the units for the measurement.

See also
setUnits()

Definition at line 59 of file qgslayoutmeasurement.h.


The documentation for this class was generated from the following files: