Skip to content

Commit

Permalink
[FEATURE] Add inches as a measurement choice for symbology/labeling
Browse files Browse the repository at this point in the history
"Make imperial great again!"
  • Loading branch information
nyalldawson committed Jan 22, 2017
1 parent b7d89a7 commit 46f2ea1
Show file tree
Hide file tree
Showing 20 changed files with 146 additions and 88 deletions.
1 change: 1 addition & 0 deletions python/core/qgsunittypes.sip
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class QgsUnitTypes
RenderPixels, //!< pixels
RenderPercentage, //!< percentage of another measurement (e.g., canvas size, feature size)
RenderPoints, //! points (e.g., for font sizes)
RenderInches,
RenderUnknownUnit, //!< mixed or unknown units
};

Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsdiagramproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ QgsDiagramProperties::QgsDiagramProperties( QgsVectorLayer* layer, QWidget* pare
connect( mAttributeBasedScalingRadio, SIGNAL( toggled( bool ) ), this, SLOT( scalingTypeChanged() ) );

mDiagramUnitComboBox->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mDiagramLineUnitComboBox->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );

QgsWkbTypes::GeometryType layerType = layer->geometryType();
if ( layerType == QgsWkbTypes::UnknownGeometry || layerType == QgsWkbTypes::NullGeometry )
Expand Down
4 changes: 4 additions & 0 deletions src/app/qgsmaptooloffsetpointsymbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ QPointF QgsMapToolOffsetPointSymbol::calculateOffset( const QgsPoint& startPoint
factor = 2.83464567 * 25.4 / mCanvas->mapSettings().outputDpi() / mCanvas->mapSettings().mapUnitsPerPixel() ;
break;

case QgsUnitTypes::RenderInches:
factor = 1.0 / mCanvas->mapSettings().outputDpi() / mCanvas->mapSettings().mapUnitsPerPixel() ;
break;

case QgsUnitTypes::RenderPixels:
factor = 1.0 / mCanvas->mapSettings().mapUnitsPerPixel();
break;
Expand Down
13 changes: 13 additions & 0 deletions src/core/qgsrendercontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "qgsfeaturefilterprovider.h"

#define POINTS_TO_MM 2.83464567
#define INCH_TO_MM 25.4

QgsRenderContext::QgsRenderContext()
: mFlags( DrawEditingInfo | UseAdvancedEffects | DrawSelection | UseRenderingOptimization )
Expand Down Expand Up @@ -224,6 +225,10 @@ double QgsRenderContext::convertToPainterUnits( double size, QgsUnitTypes::Rende
conversionFactor = mScaleFactor / POINTS_TO_MM;
break;

case QgsUnitTypes::RenderInches:
conversionFactor = mScaleFactor * INCH_TO_MM;
break;

case QgsUnitTypes::RenderMapUnits:
{
double mup = scale.computeMapUnitsPerPixel( *this );
Expand Down Expand Up @@ -303,6 +308,10 @@ double QgsRenderContext::convertToMapUnits( double size, QgsUnitTypes::RenderUni
{
return size * mScaleFactor * mup / POINTS_TO_MM;
}
case QgsUnitTypes::RenderInches:
{
return size * mScaleFactor * mup * INCH_TO_MM;
}
case QgsUnitTypes::RenderPixels:
{
return size * mup;
Expand Down Expand Up @@ -334,6 +343,10 @@ double QgsRenderContext::convertFromMapUnits( double sizeInMapUnits, QgsUnitType
{
return sizeInMapUnits / ( mScaleFactor * mup / POINTS_TO_MM );
}
case QgsUnitTypes::RenderInches:
{
return sizeInMapUnits / ( mScaleFactor * mup * INCH_TO_MM );
}
case QgsUnitTypes::RenderPixels:
{
return sizeInMapUnits / mup;
Expand Down
9 changes: 7 additions & 2 deletions src/core/qgsunittypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,9 +1081,12 @@ QString QgsUnitTypes::encodeUnit( RenderUnit unit )
return QStringLiteral( "Percentage" );
case RenderPoints:
return QStringLiteral( "Point" );
default:
return QStringLiteral( "MM" );
case RenderInches:
return QStringLiteral( "Inch" );
case RenderUnknownUnit:
return QString();
}
return QString();
}

QgsUnitTypes::RenderUnit QgsUnitTypes::decodeRenderUnit( const QString& string, bool* ok )
Expand All @@ -1109,6 +1112,8 @@ QgsUnitTypes::RenderUnit QgsUnitTypes::decodeRenderUnit( const QString& string,
return RenderPoints;
if ( normalized == QLatin1String( "points" ) )
return RenderPoints;
if ( normalized == encodeUnit( RenderInches ).toLower() )
return RenderInches;

if ( ok )
*ok = false;
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsunittypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class CORE_EXPORT QgsUnitTypes
RenderPixels, //!< Pixels
RenderPercentage, //!< Percentage of another measurement (e.g., canvas size, feature size)
RenderPoints, //! points (e.g., for font sizes)
RenderInches, //! Inches
RenderUnknownUnit, //!< Mixed or unknown units
};

Expand Down
6 changes: 3 additions & 3 deletions src/gui/effects/qgspainteffectwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ QgsShadowEffectWidget::QgsShadowEffectWidget( QWidget *parent )
mShadowColorBtn->setContext( QStringLiteral( "symbology" ) );

mOffsetUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderPixels << QgsUnitTypes::RenderMapUnits
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );

initGui();
}
Expand Down Expand Up @@ -422,7 +422,7 @@ QgsGlowWidget::QgsGlowWidget( QWidget *parent )
mColorBtn->setContext( QStringLiteral( "symbology" ) );

mSpreadUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderPixels << QgsUnitTypes::RenderMapUnits
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );

btnColorRamp->setShowGradientOnly( true );

Expand Down Expand Up @@ -612,7 +612,7 @@ QgsTransformWidget::QgsTransformWidget( QWidget *parent )
setupUi( this );

mTranslateUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderPixels << QgsUnitTypes::RenderMapUnits
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mSpinTranslateX->setClearValue( 0 );
mSpinTranslateY->setClearValue( 0 );
mSpinShearX->setClearValue( 0 );
Expand Down
22 changes: 11 additions & 11 deletions src/gui/qgstextformatwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,28 +75,28 @@ void QgsTextFormatWidget::initWidget()
unitWidget->setMapCanvas( mMapCanvas );
}
mFontSizeUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderMapUnits
<< QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderPixels );
<< QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderPixels << QgsUnitTypes::RenderInches );
mBufferUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mShapeSizeUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mShapeOffsetUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mShapeRadiusUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits
<< QgsUnitTypes::RenderPixels << QgsUnitTypes::RenderPercentage
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mShapeBorderWidthUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mShadowOffsetUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mShadowRadiusUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mPointOffsetUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mLineDistanceUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mRepeatDistanceUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );

mFontLineHeightSpinBox->setClearValue( 1.0 );
mShapeRotationDblSpnBx->setClearValue( 0.0 );
Expand Down
46 changes: 25 additions & 21 deletions src/gui/qgsunitselectionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ QgsMapUnitScaleWidget::QgsMapUnitScaleWidget( QWidget* parent )
mComboBoxMaxScale->setScale( 1 );
mSpinBoxMinSize->setShowClearButton( false );
mSpinBoxMaxSize->setShowClearButton( false );
connect( mCheckBoxMinScale, SIGNAL( toggled( bool ) ), this, SLOT( configureMinComboBox() ) );
connect( mCheckBoxMaxScale, SIGNAL( toggled( bool ) ), this, SLOT( configureMaxComboBox() ) );
connect( mComboBoxMinScale, SIGNAL( scaleChanged( double ) ), this, SLOT( configureMaxComboBox() ) );
connect( mComboBoxMinScale, SIGNAL( scaleChanged( double ) ), mComboBoxMaxScale, SLOT( setMinScale( double ) ) );
connect( mComboBoxMaxScale, SIGNAL( scaleChanged( double ) ), this, SLOT( configureMinComboBox() ) );
connect( mCheckBoxMinScale, &QCheckBox::toggled, this, &QgsMapUnitScaleWidget::configureMinComboBox );
connect( mCheckBoxMaxScale, &QCheckBox::toggled, this, &QgsMapUnitScaleWidget::configureMaxComboBox );
connect( mComboBoxMinScale, &QgsScaleWidget::scaleChanged, this, &QgsMapUnitScaleWidget::configureMaxComboBox );
connect( mComboBoxMinScale, &QgsScaleWidget::scaleChanged, mComboBoxMaxScale, &QgsScaleWidget::setMinScale );
connect( mComboBoxMaxScale, &QgsScaleWidget::scaleChanged, this, &QgsMapUnitScaleWidget::configureMinComboBox );

connect( mCheckBoxMinSize, SIGNAL( toggled( bool ) ), mSpinBoxMinSize, SLOT( setEnabled( bool ) ) );
connect( mCheckBoxMaxSize, SIGNAL( toggled( bool ) ), mSpinBoxMaxSize, SLOT( setEnabled( bool ) ) );
connect( mCheckBoxMinSize, &QCheckBox::toggled, mSpinBoxMinSize, &QgsDoubleSpinBox::setEnabled );
connect( mCheckBoxMaxSize, &QCheckBox::toggled, mSpinBoxMaxSize, &QgsDoubleSpinBox::setEnabled );

// notification of setting changes
connect( mCheckBoxMinScale, SIGNAL( toggled( bool ) ), this, SLOT( settingsChanged() ) );
connect( mCheckBoxMaxScale, SIGNAL( toggled( bool ) ), this, SLOT( settingsChanged() ) );
connect( mComboBoxMinScale, SIGNAL( scaleChanged( double ) ), this, SLOT( settingsChanged() ) );
connect( mComboBoxMaxScale, SIGNAL( scaleChanged( double ) ), this, SLOT( settingsChanged() ) );
connect( mCheckBoxMinSize, SIGNAL( toggled( bool ) ), this, SLOT( settingsChanged() ) );
connect( mCheckBoxMaxSize, SIGNAL( toggled( bool ) ), this, SLOT( settingsChanged() ) );
connect( mSpinBoxMinSize, SIGNAL( valueChanged( double ) ), this, SLOT( settingsChanged() ) );
connect( mSpinBoxMaxSize, SIGNAL( valueChanged( double ) ), this, SLOT( settingsChanged() ) );
connect( mCheckBoxMinScale, &QCheckBox::toggled, this, &QgsMapUnitScaleWidget::settingsChanged );
connect( mCheckBoxMaxScale, &QCheckBox::toggled, this, &QgsMapUnitScaleWidget::settingsChanged );
connect( mComboBoxMinScale, &QgsScaleWidget::scaleChanged, this, &QgsMapUnitScaleWidget::settingsChanged );
connect( mComboBoxMaxScale, &QgsScaleWidget::scaleChanged, this, &QgsMapUnitScaleWidget::settingsChanged );
connect( mCheckBoxMinSize, &QCheckBox::toggled, this, &QgsMapUnitScaleWidget::settingsChanged );
connect( mCheckBoxMaxSize, &QCheckBox::toggled, this, &QgsMapUnitScaleWidget::settingsChanged );
connect( mSpinBoxMinSize, static_cast < void ( QgsDoubleSpinBox::* )( double ) > ( &QgsDoubleSpinBox::valueChanged ), this, &QgsMapUnitScaleWidget::settingsChanged );
connect( mSpinBoxMaxSize, static_cast < void ( QgsDoubleSpinBox::* )( double ) > ( &QgsDoubleSpinBox::valueChanged ), this, &QgsMapUnitScaleWidget::settingsChanged );
mBlockSignals = false;
}

Expand Down Expand Up @@ -136,9 +136,9 @@ QgsUnitSelectionWidget::QgsUnitSelectionWidget( QWidget *parent )
setFocusPolicy( Qt::StrongFocus );
setFocusProxy( mUnitCombo );

connect( mUnitCombo, SIGNAL( currentIndexChanged( int ) ), this, SLOT( toggleUnitRangeButton() ) );
connect( mMapScaleButton, SIGNAL( clicked() ), this, SLOT( showDialog() ) );
connect( mUnitCombo, SIGNAL( currentIndexChanged( int ) ), this, SIGNAL( changed() ) );
connect( mUnitCombo, static_cast < void ( QComboBox::* )( int ) > ( &QComboBox::currentIndexChanged ), this, &QgsUnitSelectionWidget::toggleUnitRangeButton );
connect( mMapScaleButton, &QPushButton::clicked, this, &QgsUnitSelectionWidget::showDialog );
connect( mUnitCombo, static_cast < void ( QComboBox::* )( int ) > ( &QComboBox::currentIndexChanged ), this, &QgsUnitSelectionWidget::changed );
}

void QgsUnitSelectionWidget::setUnits( const QStringList &units, int mapUnitIdx )
Expand Down Expand Up @@ -178,6 +178,10 @@ void QgsUnitSelectionWidget::setUnits( const QgsUnitTypes::RenderUnitList &units
{
mUnitCombo->addItem( tr( "Percentage" ), QgsUnitTypes::RenderPercentage );
}
if ( units.contains( QgsUnitTypes::RenderInches ) )
{
mUnitCombo->addItem( tr( "Inches" ), QgsUnitTypes::RenderInches );
}
blockSignals( false );
}

Expand Down Expand Up @@ -222,7 +226,7 @@ void QgsUnitSelectionWidget::showDialog()
widget->setPanelTitle( tr( "Adjust scaling range" ) );
widget->setMapCanvas( mCanvas );
widget->setMapUnitScale( mMapUnitScale );
connect( widget, SIGNAL( mapUnitScaleChanged( QgsMapUnitScale ) ), this, SLOT( widgetChanged( QgsMapUnitScale ) ) );
connect( widget, &QgsMapUnitScaleWidget::mapUnitScaleChanged, this, &QgsUnitSelectionWidget::widgetChanged );
panel->openPanel( widget );
return;
}
Expand Down Expand Up @@ -267,8 +271,8 @@ QgsMapUnitScaleDialog::QgsMapUnitScaleDialog( QWidget* parent )
mWidget = new QgsMapUnitScaleWidget();
vLayout->addWidget( mWidget );
QDialogButtonBox* bbox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal );
connect( bbox, SIGNAL( accepted() ), this, SLOT( accept() ) );
connect( bbox, SIGNAL( rejected() ), this, SLOT( reject() ) );
connect( bbox, &QDialogButtonBox::accepted, this, &QgsMapUnitScaleDialog::accept );
connect( bbox, &QDialogButtonBox::rejected, this, &QgsMapUnitScaleDialog::reject );
vLayout->addWidget( bbox );
setLayout( vLayout );
}
Expand Down
10 changes: 5 additions & 5 deletions src/gui/symbology-ng/qgsarrowsymbollayerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ QgsArrowSymbolLayerWidget::QgsArrowSymbolLayerWidget( const QgsVectorLayer* vl,
setupUi( this );

mArrowWidthUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mArrowStartWidthUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mHeadLengthUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mHeadThicknessUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mOffsetUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );

mOffsetSpin->setClearValue( 0.0 );
}
Expand Down
8 changes: 4 additions & 4 deletions src/gui/symbology-ng/qgsellipsesymbollayerwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ QgsEllipseSymbolLayerWidget::QgsEllipseSymbolLayerWidget( const QgsVectorLayer*
setupUi( this );

mSymbolWidthUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mSymbolHeightUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mOutlineWidthUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mOffsetUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );

btnChangeColorFill->setAllowAlpha( true );
btnChangeColorFill->setColorDialogTitle( tr( "Select fill color" ) );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgsgraduatedsymbolrendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ QgsGraduatedSymbolRendererWidget::QgsGraduatedSymbolRendererWidget( QgsVectorLay
mExpressionWidget->setLayer( mLayer );

mSizeUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderMapUnits << QgsUnitTypes::RenderPixels
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );

spinPrecision->setMinimum( QgsRendererRangeLabelFormat::MIN_PRECISION );
spinPrecision->setMaximum( QgsRendererRangeLabelFormat::MAX_PRECISION );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgsheatmaprendererwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ QgsHeatmapRendererWidget::QgsHeatmapRendererWidget( QgsVectorLayer* layer, QgsSt
setupUi( this );

mRadiusUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderPixels << QgsUnitTypes::RenderMapUnits
<< QgsUnitTypes::RenderPoints );
<< QgsUnitTypes::RenderPoints << QgsUnitTypes::RenderInches );
mWeightExpressionWidget->registerExpressionContextGenerator( this );

if ( renderer )
Expand Down
Loading

1 comment on commit 46f2ea1

@nirvn
Copy link
Contributor

@nirvn nirvn commented on 46f2ea1 Jan 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a feature or a regression? ;-P

Please sign in to comment.