mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			111 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			111 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/core/layout/qgslayoutmeasurement.h                               *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | 
						|
 ************************************************************************/
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
class QgsLayoutMeasurement
 | 
						|
{
 | 
						|
%Docstring(signature="appended")
 | 
						|
Provides a method of storing measurements for use in QGIS layouts using
 | 
						|
a variety of different measurement units.
 | 
						|
 | 
						|
.. seealso:: :py:class:`QgsLayoutMeasurementConverter`
 | 
						|
%End
 | 
						|
 | 
						|
%TypeHeaderCode
 | 
						|
#include "qgslayoutmeasurement.h"
 | 
						|
%End
 | 
						|
  public:
 | 
						|
 | 
						|
    explicit QgsLayoutMeasurement( double length, Qgis::LayoutUnit units = Qgis::LayoutUnit::Millimeters );
 | 
						|
%Docstring
 | 
						|
Constructor for QgsLayoutMeasurement.
 | 
						|
 | 
						|
:param length: measurement length
 | 
						|
:param units: measurement units
 | 
						|
%End
 | 
						|
 | 
						|
    double length() const;
 | 
						|
%Docstring
 | 
						|
Returns the length of the measurement.
 | 
						|
 | 
						|
.. seealso:: :py:func:`setLength`
 | 
						|
%End
 | 
						|
 | 
						|
    void setLength( const double length );
 | 
						|
%Docstring
 | 
						|
Sets the ``length`` of the measurement.
 | 
						|
 | 
						|
.. seealso:: :py:func:`length`
 | 
						|
%End
 | 
						|
 | 
						|
    Qgis::LayoutUnit units() const;
 | 
						|
%Docstring
 | 
						|
Returns the units for the measurement.
 | 
						|
 | 
						|
.. seealso:: :py:func:`setUnits`
 | 
						|
%End
 | 
						|
 | 
						|
    void setUnits( const Qgis::LayoutUnit units );
 | 
						|
%Docstring
 | 
						|
Sets the ``units`` for the measurement. Does not alter the stored
 | 
						|
length, ie. no length conversion is done.
 | 
						|
 | 
						|
.. seealso:: :py:func:`units`
 | 
						|
%End
 | 
						|
 | 
						|
    QString encodeMeasurement() const;
 | 
						|
%Docstring
 | 
						|
Encodes the layout measurement to a string
 | 
						|
 | 
						|
.. seealso:: :py:func:`decodeMeasurement`
 | 
						|
%End
 | 
						|
 | 
						|
    static QgsLayoutMeasurement decodeMeasurement( const QString &string );
 | 
						|
%Docstring
 | 
						|
Decodes a measurement from a ``string``.
 | 
						|
 | 
						|
.. seealso:: :py:func:`encodeMeasurement`
 | 
						|
%End
 | 
						|
 | 
						|
    bool operator==( QgsLayoutMeasurement other ) const;
 | 
						|
    bool operator!=( QgsLayoutMeasurement other ) const;
 | 
						|
 | 
						|
    QgsLayoutMeasurement operator+( double v ) const;
 | 
						|
 | 
						|
    QgsLayoutMeasurement operator+=( double v );
 | 
						|
 | 
						|
    QgsLayoutMeasurement operator-( double v ) const;
 | 
						|
 | 
						|
    QgsLayoutMeasurement operator-=( double v );
 | 
						|
 | 
						|
    QgsLayoutMeasurement operator*( double v ) const;
 | 
						|
 | 
						|
    QgsLayoutMeasurement operator*=( double v );
 | 
						|
 | 
						|
    QgsLayoutMeasurement operator/( double v ) const;
 | 
						|
 | 
						|
    QgsLayoutMeasurement operator/=( double v );
 | 
						|
 | 
						|
    SIP_PYOBJECT __repr__();
 | 
						|
%MethodCode
 | 
						|
    QString str = QStringLiteral( "<QgsLayoutMeasurement: %1 %2 >" ).arg( sipCpp->length() ).arg( QgsUnitTypes::toAbbreviatedString( sipCpp->units() ) );
 | 
						|
    sipRes = PyUnicode_FromString( str.toUtf8().constData() );
 | 
						|
%End
 | 
						|
 | 
						|
};
 | 
						|
 | 
						|
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/core/layout/qgslayoutmeasurement.h                               *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | 
						|
 ************************************************************************/
 |