QGIS/python/core/layout/qgslayoutmeasurement.sip

132 lines
3.5 KiB
Plaintext
Raw Normal View History

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutmeasurement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsLayoutMeasurement
{
%Docstring
This class provides a method of storing measurements for use in QGIS layouts
2017-12-15 10:36:55 -04:00
using a variety of different measurement units.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:class:`QgsLayoutMeasurementConverter`
2017-12-15 10:36:55 -04:00
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgslayoutmeasurement.h"
%End
public:
explicit QgsLayoutMeasurement( const double length, const QgsUnitTypes::LayoutUnit units = QgsUnitTypes::LayoutMillimeters );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsLayoutMeasurement.
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param length: measurement length
:param units: measurement units
%End
double length() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the length of the measurement.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setLength()`
%End
void setLength( const double length );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``length`` of the measurement.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`length()`
%End
QgsUnitTypes::LayoutUnit units() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the units for the measurement.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setUnits()`
%End
void setUnits( const QgsUnitTypes::LayoutUnit units );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the ``units`` for the measurement. Does not alter the stored length,
ie. no length conversion is done.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`units()`
%End
QString encodeMeasurement() const;
%Docstring
2017-12-15 10:36:55 -04:00
Encodes the layout measurement to a string
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`decodeMeasurement()`
%End
static QgsLayoutMeasurement decodeMeasurement( const QString &string );
%Docstring
2017-12-15 10:36:55 -04:00
Decodes a measurement from a ``string``.
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`encodeMeasurement()`
%End
bool operator==( const QgsLayoutMeasurement &other ) const;
bool operator!=( const QgsLayoutMeasurement &other ) const;
2017-06-26 11:14:58 +10:00
QgsLayoutMeasurement operator+( const double v ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Adds a scalar value to the measurement.
%End
2017-06-26 11:14:58 +10:00
QgsLayoutMeasurement operator+=( const double v );
%Docstring
2017-12-15 10:36:55 -04:00
Adds a scalar value to the measurement.
%End
2017-06-26 11:14:58 +10:00
QgsLayoutMeasurement operator-( const double v ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Subtracts a scalar value from the measurement.
%End
2017-06-26 11:14:58 +10:00
QgsLayoutMeasurement operator-=( const double v );
%Docstring
2017-12-15 10:36:55 -04:00
Subtracts a scalar value from the measurement.
%End
2017-06-26 11:14:58 +10:00
QgsLayoutMeasurement operator*( const double v ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Multiplies the measurement by a scalar value.
%End
2017-06-26 11:14:58 +10:00
QgsLayoutMeasurement operator*=( const double v );
%Docstring
2017-12-15 10:36:55 -04:00
Multiplies the measurement by a scalar value.
%End
2017-06-26 11:14:58 +10:00
QgsLayoutMeasurement operator/( const double v ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Divides the measurement by a scalar value.
%End
2017-06-26 11:14:58 +10:00
QgsLayoutMeasurement operator/=( const double v );
%Docstring
2017-12-15 10:36:55 -04:00
Divides the measurement by a scalar value.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutmeasurement.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/