2017-06-23 16:34:20 +10:00
|
|
|
/************************************************************************
|
|
|
|
* 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
|
2018-05-26 14:10:30 +10:00
|
|
|
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
|
|
|
|
2017-06-23 16:34:20 +10:00
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
|
|
|
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgslayoutmeasurement.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
2018-06-04 21:56:07 +10:00
|
|
|
explicit QgsLayoutMeasurement( double length, QgsUnitTypes::LayoutUnit units = QgsUnitTypes::LayoutMillimeters );
|
2017-06-23 16:34:20 +10:00
|
|
|
%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
|
2017-06-23 16:34:20 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
double length() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the length of the measurement.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setLength`
|
2017-06-23 16:34:20 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setLength( const double length );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the ``length`` of the measurement.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`length`
|
2017-06-23 16:34:20 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QgsUnitTypes::LayoutUnit units() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the units for the measurement.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setUnits`
|
2017-06-23 16:34:20 +10:00
|
|
|
%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.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`units`
|
2017-06-23 16:34:20 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
QString encodeMeasurement() const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Encodes the layout measurement to a string
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`decodeMeasurement`
|
2017-06-23 16:34:20 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
static QgsLayoutMeasurement decodeMeasurement( const QString &string );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Decodes a measurement from a ``string``.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`encodeMeasurement`
|
2017-06-23 16:34:20 +10:00
|
|
|
%End
|
|
|
|
|
2018-08-13 13:00:14 +10:00
|
|
|
bool operator==( QgsLayoutMeasurement other ) const;
|
|
|
|
bool operator!=( QgsLayoutMeasurement other ) const;
|
2017-06-26 11:14:58 +10:00
|
|
|
|
2018-06-04 21:56:07 +10:00
|
|
|
QgsLayoutMeasurement operator+( double v ) const;
|
2017-06-26 11:14:58 +10:00
|
|
|
|
2018-06-04 21:56:07 +10:00
|
|
|
QgsLayoutMeasurement operator+=( double v );
|
2017-06-26 11:14:58 +10:00
|
|
|
|
2018-06-04 21:56:07 +10:00
|
|
|
QgsLayoutMeasurement operator-( double v ) const;
|
2017-06-26 11:14:58 +10:00
|
|
|
|
2018-06-04 21:56:07 +10:00
|
|
|
QgsLayoutMeasurement operator-=( double v );
|
2017-06-26 11:14:58 +10:00
|
|
|
|
2018-06-04 21:56:07 +10:00
|
|
|
QgsLayoutMeasurement operator*( double v ) const;
|
2017-06-26 11:14:58 +10:00
|
|
|
|
2018-06-04 21:56:07 +10:00
|
|
|
QgsLayoutMeasurement operator*=( double v );
|
2017-06-26 11:14:58 +10:00
|
|
|
|
2018-06-04 21:56:07 +10:00
|
|
|
QgsLayoutMeasurement operator/( double v ) const;
|
2017-06-26 11:14:58 +10:00
|
|
|
|
2018-06-04 21:56:07 +10:00
|
|
|
QgsLayoutMeasurement operator/=( double v );
|
2017-06-23 16:34:20 +10:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/core/layout/qgslayoutmeasurement.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|