Skip to content
Permalink
Browse files

Modernise some code

  • Loading branch information
nyalldawson committed Jun 26, 2017
1 parent 2bc8ff3 commit 8791aacd74c1bc2ab47674e53b8996bda76560a0
@@ -27,6 +27,9 @@ class QgsLayoutMeasurementConverter
public:

QgsLayoutMeasurementConverter();
%Docstring
Constructor for QgsLayoutMeasurementConverter.
%End

void setDpi( const double dpi );
%Docstring
@@ -123,8 +123,8 @@ class CORE_EXPORT QgsLayoutMeasurement

private:

double mLength;
QgsUnitTypes::LayoutUnit mUnits;
double mLength = 0.0;
QgsUnitTypes::LayoutUnit mUnits = QgsUnitTypes::LayoutMillimeters;

};

@@ -18,11 +18,6 @@
#include "qgslayoutmeasurementconverter.h"


QgsLayoutMeasurementConverter::QgsLayoutMeasurementConverter()
: mDpi( 300.0 )
{
}

QgsLayoutMeasurement QgsLayoutMeasurementConverter::convert( const QgsLayoutMeasurement &measurement, const QgsUnitTypes::LayoutUnit targetUnits ) const
{
if ( measurement.units() == targetUnits )
@@ -41,7 +41,10 @@ class CORE_EXPORT QgsLayoutMeasurementConverter
{
public:

QgsLayoutMeasurementConverter();
/**
* Constructor for QgsLayoutMeasurementConverter.
*/
QgsLayoutMeasurementConverter() = default;

/**
* Sets the dots per inch (\a dpi) for the measurement converter. This is used
@@ -83,7 +86,7 @@ class CORE_EXPORT QgsLayoutMeasurementConverter

private:

double mDpi;
double mDpi = 300.0;

double convertToMillimeters( const QgsLayoutMeasurement &measurement ) const;
double convertToCentimeters( const QgsLayoutMeasurement &measurement ) const;
@@ -29,9 +29,7 @@ QgsLayoutPoint::QgsLayoutPoint( const double x, const double y, const QgsUnitTyp
}

QgsLayoutPoint::QgsLayoutPoint( const QgsUnitTypes::LayoutUnit units )
: mX( 0.0 )
, mY( 0.0 )
, mUnits( units )
: mUnits( units )
{

}
@@ -151,9 +151,9 @@ class CORE_EXPORT QgsLayoutPoint

private:

double mX;
double mY;
QgsUnitTypes::LayoutUnit mUnits;
double mX = 0.0;
double mY = 0.0;
QgsUnitTypes::LayoutUnit mUnits = QgsUnitTypes::LayoutMillimeters;

};

@@ -27,9 +27,7 @@ QgsLayoutSize::QgsLayoutSize( const double width, const double height, const Qgs
}

QgsLayoutSize::QgsLayoutSize( const QgsUnitTypes::LayoutUnit units )
: mWidth( 0.0 )
, mHeight( 0.0 )
, mUnits( units )
: mUnits( units )
{

}
@@ -155,9 +155,9 @@ class CORE_EXPORT QgsLayoutSize

private:

double mWidth;
double mHeight;
QgsUnitTypes::LayoutUnit mUnits;
double mWidth = 0.0;
double mHeight = 0.0;
QgsUnitTypes::LayoutUnit mUnits = QgsUnitTypes::LayoutMillimeters;

};

0 comments on commit 8791aac

Please sign in to comment.
You can’t perform that action at this time.