Skip to content

Commit

Permalink
Add missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 26, 2017
1 parent 6a54130 commit 2bc8ff3
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 43 deletions.
18 changes: 16 additions & 2 deletions python/core/layout/qgslayoutmeasurement.sip
Expand Up @@ -31,8 +31,6 @@ class QgsLayoutMeasurement
\param units measurement units
%End

~QgsLayoutMeasurement();

double length() const;
%Docstring
Returns the length of the measurement.
Expand Down Expand Up @@ -79,36 +77,52 @@ class QgsLayoutMeasurement
%Docstring
:rtype: bool
%End

QgsLayoutMeasurement operator+( const double v ) const;
%Docstring
Adds a scalar value to the measurement.
:rtype: QgsLayoutMeasurement
%End

QgsLayoutMeasurement operator+=( const double v );
%Docstring
Adds a scalar value to the measurement.
:rtype: QgsLayoutMeasurement
%End

QgsLayoutMeasurement operator-( const double v ) const;
%Docstring
Subtracts a scalar value from the measurement.
:rtype: QgsLayoutMeasurement
%End

QgsLayoutMeasurement operator-=( const double v );
%Docstring
Subtracts a scalar value from the measurement.
:rtype: QgsLayoutMeasurement
%End

QgsLayoutMeasurement operator*( const double v ) const;
%Docstring
Multiplies the measurement by a scalar value.
:rtype: QgsLayoutMeasurement
%End

QgsLayoutMeasurement operator*=( const double v );
%Docstring
Multiplies the measurement by a scalar value.
:rtype: QgsLayoutMeasurement
%End

QgsLayoutMeasurement operator/( const double v ) const;
%Docstring
Divides the measurement by a scalar value.
:rtype: QgsLayoutMeasurement
%End

QgsLayoutMeasurement operator/=( const double v );
%Docstring
Divides the measurement by a scalar value.
:rtype: QgsLayoutMeasurement
%End

Expand Down
2 changes: 0 additions & 2 deletions python/core/layout/qgslayoutmeasurementconverter.sip
Expand Up @@ -28,8 +28,6 @@ class QgsLayoutMeasurementConverter

QgsLayoutMeasurementConverter();

~QgsLayoutMeasurementConverter();

void setDpi( const double dpi );
%Docstring
Sets the dots per inch (``dpi``) for the measurement converter. This is used
Expand Down
13 changes: 8 additions & 5 deletions python/core/layout/qgslayoutpoint.sip
Expand Up @@ -34,9 +34,6 @@ class QgsLayoutPoint
QgsLayoutPoint( const double x, const double y, const QgsUnitTypes::LayoutUnit units = QgsUnitTypes::LayoutMillimeters );
%Docstring
Constructor for QgsLayoutPoint.
\param x x coordinate
\param x y coordinate
\param units units for x and y
%End

explicit QgsLayoutPoint( const QgsUnitTypes::LayoutUnit units = QgsUnitTypes::LayoutMillimeters );
Expand All @@ -45,8 +42,6 @@ class QgsLayoutPoint
\param units units for measurement
%End

~QgsLayoutPoint();

void setPoint( const double x, const double y );
%Docstring
Sets new x and y coordinates for the point.
Expand Down Expand Up @@ -134,20 +129,28 @@ class QgsLayoutPoint
%Docstring
:rtype: bool
%End

QgsLayoutPoint operator*( const double v ) const;
%Docstring
Multiplies the x and y by a scalar value.
:rtype: QgsLayoutPoint
%End

QgsLayoutPoint operator*=( const double v );
%Docstring
Multiplies the x and y by a scalar value.
:rtype: QgsLayoutPoint
%End

QgsLayoutPoint operator/( const double v ) const;
%Docstring
Divides the x and y by a scalar value.
:rtype: QgsLayoutPoint
%End

QgsLayoutPoint operator/=( const double v );
%Docstring
Divides the x and y by a scalar value.
:rtype: QgsLayoutPoint
%End

Expand Down
10 changes: 8 additions & 2 deletions python/core/layout/qgslayoutsize.sip
Expand Up @@ -46,8 +46,6 @@ class QgsLayoutSize
\param units units for measurement
%End

~QgsLayoutSize();

void setSize( const double width, const double height );
%Docstring
Sets new ``width`` and ``height`` for the size.
Expand Down Expand Up @@ -135,20 +133,28 @@ class QgsLayoutSize
%Docstring
:rtype: bool
%End

QgsLayoutSize operator*( const double v ) const;
%Docstring
Multiplies the width and height by a scalar value.
:rtype: QgsLayoutSize
%End

QgsLayoutSize operator*=( const double v );
%Docstring
Multiplies the width and height by a scalar value.
:rtype: QgsLayoutSize
%End

QgsLayoutSize operator/( const double v ) const;
%Docstring
Divides the width and height by a scalar value.
:rtype: QgsLayoutSize
%End

QgsLayoutSize operator/=( const double v );
%Docstring
Divides the width and height by a scalar value.
:rtype: QgsLayoutSize
%End

Expand Down
4 changes: 0 additions & 4 deletions src/core/layout/qgslayoutmeasurement.cpp
Expand Up @@ -25,10 +25,6 @@ QgsLayoutMeasurement::QgsLayoutMeasurement( const double length, const QgsUnitTy
{
}

QgsLayoutMeasurement::~QgsLayoutMeasurement()
{
}

QString QgsLayoutMeasurement::encodeMeasurement() const
{
return QStringLiteral( "%1,%2" ).arg( mLength ).arg( QgsUnitTypes::encodeUnit( mUnits ) );
Expand Down
37 changes: 34 additions & 3 deletions src/core/layout/qgslayoutmeasurement.h
Expand Up @@ -22,7 +22,8 @@

#include "qgsunittypes.h"

/** \ingroup Layout
/**
* \ingroup core
* \class QgsLayoutMeasurement
* \brief This class provides a method of storing measurements for use in QGIS layouts
* using a variety of different measurement units.
Expand All @@ -40,8 +41,6 @@ class CORE_EXPORT QgsLayoutMeasurement
*/
explicit QgsLayoutMeasurement( const double length, const QgsUnitTypes::LayoutUnit units = QgsUnitTypes::LayoutMillimeters );

~QgsLayoutMeasurement();

/**
* Returns the length of the measurement.
* \see setLength()
Expand Down Expand Up @@ -81,13 +80,45 @@ class CORE_EXPORT QgsLayoutMeasurement

bool operator==( const QgsLayoutMeasurement &other ) const;
bool operator!=( const QgsLayoutMeasurement &other ) const;

/**
* Adds a scalar value to the measurement.
*/
QgsLayoutMeasurement operator+( const double v ) const;

/**
* Adds a scalar value to the measurement.
*/
QgsLayoutMeasurement operator+=( const double v );

/**
* Subtracts a scalar value from the measurement.
*/
QgsLayoutMeasurement operator-( const double v ) const;

/**
* Subtracts a scalar value from the measurement.
*/
QgsLayoutMeasurement operator-=( const double v );

/**
* Multiplies the measurement by a scalar value.
*/
QgsLayoutMeasurement operator*( const double v ) const;

/**
* Multiplies the measurement by a scalar value.
*/
QgsLayoutMeasurement operator*=( const double v );

/**
* Divides the measurement by a scalar value.
*/
QgsLayoutMeasurement operator/( const double v ) const;

/**
* Divides the measurement by a scalar value.
*/
QgsLayoutMeasurement operator/=( const double v );

private:
Expand Down
4 changes: 0 additions & 4 deletions src/core/layout/qgslayoutmeasurementconverter.cpp
Expand Up @@ -23,10 +23,6 @@ QgsLayoutMeasurementConverter::QgsLayoutMeasurementConverter()
{
}

QgsLayoutMeasurementConverter::~QgsLayoutMeasurementConverter()
{
}

QgsLayoutMeasurement QgsLayoutMeasurementConverter::convert( const QgsLayoutMeasurement &measurement, const QgsUnitTypes::LayoutUnit targetUnits ) const
{
if ( measurement.units() == targetUnits )
Expand Down
4 changes: 1 addition & 3 deletions src/core/layout/qgslayoutmeasurementconverter.h
Expand Up @@ -28,7 +28,7 @@


/**
* \ingroup Layout
* \ingroup core
* \class QgsLayoutMeasurementConverter
* \brief This class provides a method of converting QgsLayoutMeasurements from
* one unit to another. Conversion to or from pixel units utilizes a specified
Expand All @@ -43,8 +43,6 @@ class CORE_EXPORT QgsLayoutMeasurementConverter

QgsLayoutMeasurementConverter();

~QgsLayoutMeasurementConverter();

/**
* Sets the dots per inch (\a dpi) for the measurement converter. This is used
* when converting measurements to and from pixels.
Expand Down
5 changes: 0 additions & 5 deletions src/core/layout/qgslayoutpoint.cpp
Expand Up @@ -36,11 +36,6 @@ QgsLayoutPoint::QgsLayoutPoint( const QgsUnitTypes::LayoutUnit units )

}

QgsLayoutPoint::~QgsLayoutPoint()
{

}

bool QgsLayoutPoint::isNull() const
{
return qgsDoubleNear( mX, 0 ) && qgsDoubleNear( mY, 0 );
Expand Down
24 changes: 18 additions & 6 deletions src/core/layout/qgslayoutpoint.h
Expand Up @@ -22,7 +22,8 @@
#include "qgsunittypes.h"
#include <QPointF>

/** \ingroup Layout
/**
* \ingroup core
* \class QgsLayoutPoint
* \brief This class provides a method of storing points, consisting of an x and y coordinate,
* for use in QGIS layouts. Measurement units are stored alongside the position.
Expand All @@ -41,9 +42,6 @@ class CORE_EXPORT QgsLayoutPoint

/**
* Constructor for QgsLayoutPoint.
* \param x x coordinate
* \param x y coordinate
* \param units units for x and y
*/
QgsLayoutPoint( const double x, const double y, const QgsUnitTypes::LayoutUnit units = QgsUnitTypes::LayoutMillimeters );

Expand All @@ -53,8 +51,6 @@ class CORE_EXPORT QgsLayoutPoint
*/
explicit QgsLayoutPoint( const QgsUnitTypes::LayoutUnit units = QgsUnitTypes::LayoutMillimeters );

~QgsLayoutPoint();

/**
* Sets new x and y coordinates for the point.
* \see setX()
Expand Down Expand Up @@ -132,9 +128,25 @@ class CORE_EXPORT QgsLayoutPoint

bool operator==( const QgsLayoutPoint &other ) const;
bool operator!=( const QgsLayoutPoint &other ) const;

/**
* Multiplies the x and y by a scalar value.
*/
QgsLayoutPoint operator*( const double v ) const;

/**
* Multiplies the x and y by a scalar value.
*/
QgsLayoutPoint operator*=( const double v );

/**
* Divides the x and y by a scalar value.
*/
QgsLayoutPoint operator/( const double v ) const;

/**
* Divides the x and y by a scalar value.
*/
QgsLayoutPoint operator/=( const double v );

private:
Expand Down
4 changes: 0 additions & 4 deletions src/core/layout/qgslayoutsize.cpp
Expand Up @@ -34,10 +34,6 @@ QgsLayoutSize::QgsLayoutSize( const QgsUnitTypes::LayoutUnit units )

}

QgsLayoutSize::~QgsLayoutSize()
{
}

bool QgsLayoutSize::isEmpty() const
{
return qgsDoubleNear( mWidth, 0 ) && qgsDoubleNear( mHeight, 0 );
Expand Down
20 changes: 17 additions & 3 deletions src/core/layout/qgslayoutsize.h
Expand Up @@ -24,7 +24,7 @@


/**
* \ingroup Layout
* \ingroup core
* \class QgsLayoutSize
* \brief This class provides a method of storing sizes, consisting of a width and height,
* for use in QGIS layouts. Measurement units are stored alongside the size.
Expand Down Expand Up @@ -55,8 +55,6 @@ class CORE_EXPORT QgsLayoutSize
*/
explicit QgsLayoutSize( const QgsUnitTypes::LayoutUnit units = QgsUnitTypes::LayoutMillimeters );

~QgsLayoutSize();

/**
* Sets new \a width and \a height for the size.
* \see setWidth()
Expand Down Expand Up @@ -134,9 +132,25 @@ class CORE_EXPORT QgsLayoutSize

bool operator==( const QgsLayoutSize &other ) const;
bool operator!=( const QgsLayoutSize &other ) const;

/**
* Multiplies the width and height by a scalar value.
*/
QgsLayoutSize operator*( const double v ) const;

/**
* Multiplies the width and height by a scalar value.
*/
QgsLayoutSize operator*=( const double v );

/**
* Divides the width and height by a scalar value.
*/
QgsLayoutSize operator/( const double v ) const;

/**
* Divides the width and height by a scalar value.
*/
QgsLayoutSize operator/=( const double v );

private:
Expand Down

0 comments on commit 2bc8ff3

Please sign in to comment.