QGIS API Documentation  3.2.0-Bonn (bc43194)
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, QgsUnitTypes::LayoutUnit units=QgsUnitTypes::LayoutMillimeters)
 Constructor for QgsLayoutMeasurement. More...
 
QString encodeMeasurement () const
 Encodes the layout measurement to a string. More...
 
double length () const
 Returns the length of the measurement. More...
 
bool operator!= (const QgsLayoutMeasurement &other) const
 
QgsLayoutMeasurement operator* (double v) const
 Multiplies the measurement by a scalar value. More...
 
QgsLayoutMeasurement operator*= (double v)
 Multiplies the measurement by a scalar value. More...
 
QgsLayoutMeasurement operator+ (double v) const
 Adds a scalar value to the measurement. More...
 
QgsLayoutMeasurement operator+= (double v)
 Adds a scalar value to the measurement. More...
 
QgsLayoutMeasurement operator- (double v) const
 Subtracts a scalar value from the measurement. More...
 
QgsLayoutMeasurement operator-= (double v)
 Subtracts a scalar value from the measurement. More...
 
QgsLayoutMeasurement operator/ (double v) const
 Divides the measurement by a scalar value. More...
 
QgsLayoutMeasurement operator/= (double v)
 Divides the measurement by a scalar value. More...
 
bool operator== (const QgsLayoutMeasurement &other) const
 
void setLength (const double length)
 Sets the length of the measurement. More...
 
void setUnits (const QgsUnitTypes::LayoutUnit units)
 Sets the units for the measurement. More...
 
QgsUnitTypes::LayoutUnit units () const
 Returns the units for the measurement. More...
 

Static Public Member Functions

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

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
Since
QGIS 3.0

Definition at line 33 of file qgslayoutmeasurement.h.

Constructor & Destructor Documentation

◆ QgsLayoutMeasurement()

QgsLayoutMeasurement::QgsLayoutMeasurement ( double  length,
QgsUnitTypes::LayoutUnit  units = QgsUnitTypes::LayoutMillimeters 
)
explicit

Constructor for QgsLayoutMeasurement.

Parameters
lengthmeasurement length
unitsmeasurement units

Definition at line 22 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 33 of file qgslayoutmeasurement.cpp.

◆ encodeMeasurement()

QString QgsLayoutMeasurement::encodeMeasurement ( ) const

Encodes the layout measurement to a string.

See also
decodeMeasurement()

Definition at line 28 of file qgslayoutmeasurement.cpp.

◆ length()

double QgsLayoutMeasurement::length ( ) const
inline

Returns the length of the measurement.

See also
setLength()

Definition at line 48 of file qgslayoutmeasurement.h.

◆ operator!=()

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

Definition at line 48 of file qgslayoutmeasurement.cpp.

◆ operator*()

QgsLayoutMeasurement QgsLayoutMeasurement::operator* ( double  v) const

Multiplies the measurement by a scalar value.

Definition at line 75 of file qgslayoutmeasurement.cpp.

◆ operator*=()

QgsLayoutMeasurement QgsLayoutMeasurement::operator*= ( double  v)

Multiplies the measurement by a scalar value.

Definition at line 80 of file qgslayoutmeasurement.cpp.

◆ operator+()

QgsLayoutMeasurement QgsLayoutMeasurement::operator+ ( double  v) const

Adds a scalar value to the measurement.

Definition at line 53 of file qgslayoutmeasurement.cpp.

◆ operator+=()

QgsLayoutMeasurement QgsLayoutMeasurement::operator+= ( double  v)

Adds a scalar value to the measurement.

Definition at line 58 of file qgslayoutmeasurement.cpp.

◆ operator-()

QgsLayoutMeasurement QgsLayoutMeasurement::operator- ( double  v) const

Subtracts a scalar value from the measurement.

Definition at line 64 of file qgslayoutmeasurement.cpp.

◆ operator-=()

QgsLayoutMeasurement QgsLayoutMeasurement::operator-= ( double  v)

Subtracts a scalar value from the measurement.

Definition at line 69 of file qgslayoutmeasurement.cpp.

◆ operator/()

QgsLayoutMeasurement QgsLayoutMeasurement::operator/ ( double  v) const

Divides the measurement by a scalar value.

Definition at line 86 of file qgslayoutmeasurement.cpp.

◆ operator/=()

QgsLayoutMeasurement QgsLayoutMeasurement::operator/= ( double  v)

Divides the measurement by a scalar value.

Definition at line 91 of file qgslayoutmeasurement.cpp.

◆ operator==()

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

Definition at line 43 of file qgslayoutmeasurement.cpp.

◆ setLength()

void QgsLayoutMeasurement::setLength ( const double  length)
inline

Sets the length of the measurement.

See also
length()

Definition at line 54 of file qgslayoutmeasurement.h.

◆ setUnits()

void QgsLayoutMeasurement::setUnits ( const QgsUnitTypes::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 67 of file qgslayoutmeasurement.h.

◆ units()

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

Returns the units for the measurement.

See also
setUnits()

Definition at line 60 of file qgslayoutmeasurement.h.


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