Skip to content
Permalink
Browse files

Clean up API for QgsUnitSelectionWidget

Makes the widget easier to use, avoids duplicate code
  • Loading branch information
nyalldawson committed Mar 22, 2015
1 parent 1272870 commit 0d241b794a2183120a9b8db7258c824640b2ee1c
@@ -58,17 +58,17 @@ QgsLabelingGui::QgsLabelingGui( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas,
return;

setupUi( this );
mFontSizeUnitWidget->setUnits( QStringList() << tr( "points" ) << tr( "map units" ), 1 );
mBufferUnitWidget->setUnits( QStringList() << tr( "mm" ) << tr( "map units" ), 1 );
mShapeSizeUnitWidget->setUnits( QStringList() << tr( "mm" ) << tr( "map units" ), 1 );
mShapeOffsetUnitWidget->setUnits( QStringList() << tr( "mm" ) << tr( "map units" ), 1 );
mShapeRadiusUnitWidget->setUnits( QStringList() << tr( "mm" ) << tr( "map units" ) << tr( "% of length" ), 1 );
mShapeBorderWidthUnitWidget->setUnits( QStringList() << tr( "mm" ) << tr( "map units" ), 1 );
mShadowOffsetUnitWidget->setUnits( QStringList() << tr( "mm" ) << tr( "map units" ), 1 );
mShadowRadiusUnitWidget->setUnits( QStringList() << tr( "mm" ) << tr( "map units" ), 1 );
mPointOffsetUnitWidget->setUnits( QStringList() << tr( "mm" ) << tr( "map units" ), 1 );
mLineDistanceUnitWidget->setUnits( QStringList() << tr( "mm" ) << tr( "map units" ), 1 );
mRepeatDistanceUnitWidget->setUnits( QStringList() << tr( "mm" ) << tr( "map units" ), 1 );
mFontSizeUnitWidget->setUnits( QStringList() << tr( "Points" ) << tr( "Map unit" ), 1 );
mBufferUnitWidget->setUnits( QgsSymbolV2::OutputUnitList() << QgsSymbolV2::MM << QgsSymbolV2::MapUnit );
mShapeSizeUnitWidget->setUnits( QgsSymbolV2::OutputUnitList() << QgsSymbolV2::MM << QgsSymbolV2::MapUnit );
mShapeOffsetUnitWidget->setUnits( QgsSymbolV2::OutputUnitList() << QgsSymbolV2::MM << QgsSymbolV2::MapUnit );
mShapeRadiusUnitWidget->setUnits( QStringList() << tr( "Millimeter" ) << tr( "Map unit" ) << tr( "% of length" ), 1 );
mShapeBorderWidthUnitWidget->setUnits( QgsSymbolV2::OutputUnitList() << QgsSymbolV2::MM << QgsSymbolV2::MapUnit );
mShadowOffsetUnitWidget->setUnits( QgsSymbolV2::OutputUnitList() << QgsSymbolV2::MM << QgsSymbolV2::MapUnit );
mShadowRadiusUnitWidget->setUnits( QgsSymbolV2::OutputUnitList() << QgsSymbolV2::MM << QgsSymbolV2::MapUnit );
mPointOffsetUnitWidget->setUnits( QgsSymbolV2::OutputUnitList() << QgsSymbolV2::MM << QgsSymbolV2::MapUnit );
mLineDistanceUnitWidget->setUnits( QgsSymbolV2::OutputUnitList() << QgsSymbolV2::MM << QgsSymbolV2::MapUnit );
mRepeatDistanceUnitWidget->setUnits( QgsSymbolV2::OutputUnitList() << QgsSymbolV2::MM << QgsSymbolV2::MapUnit );

mFontLineHeightSpinBox->setClearValue( 1.0 );
mShapeRotationDblSpnBx->setClearValue( 0.0 );
@@ -305,7 +305,7 @@ void QgsLabelingGui::init()
radAroundCentroid->setChecked( true );

mLineDistanceSpnBx->setValue( lyr.dist );
mLineDistanceUnitWidget->setUnit( lyr.distInMapUnits ? 1 : 0 );
mLineDistanceUnitWidget->setUnit( lyr.distInMapUnits ? QgsSymbolV2::MapUnit : QgsSymbolV2::MM );
mLineDistanceUnitWidget->setMapUnitScale( lyr.distMapUnitScale );
//spinAngle->setValue( lyr.angle ); // TODO: uncomment when supported
break;
@@ -316,7 +316,7 @@ void QgsLabelingGui::init()
mQuadrantBtnGrp->button(( int )lyr.quadOffset )->setChecked( true );
mPointOffsetXSpinBox->setValue( lyr.xOffset );
mPointOffsetYSpinBox->setValue( lyr.yOffset );
mPointOffsetUnitWidget->setUnit( lyr.labelOffsetInMapUnits ? 1 : 0 );
mPointOffsetUnitWidget->setUnit( lyr.labelOffsetInMapUnits ? QgsSymbolV2::MapUnit : QgsSymbolV2::MM );
mPointOffsetUnitWidget->setMapUnitScale( lyr.labelOffsetMapUnitScale );
mPointAngleSpinBox->setValue( lyr.angleOffset );
break;
@@ -339,7 +339,7 @@ void QgsLabelingGui::init()
if ( lyr.placement == QgsPalLayerSettings::Line || lyr.placement == QgsPalLayerSettings::Curved )
{
mLineDistanceSpnBx->setValue( lyr.dist );
mLineDistanceUnitWidget->setUnit( lyr.distInMapUnits ? 1 : 0 );
mLineDistanceUnitWidget->setUnit( lyr.distInMapUnits ? QgsSymbolV2::MapUnit : QgsSymbolV2::MM );
mLineDistanceUnitWidget->setMapUnitScale( lyr.distMapUnitScale );
chkLineAbove->setChecked( lyr.placementFlags & QgsPalLayerSettings::AboveLine );
chkLineBelow->setChecked( lyr.placementFlags & QgsPalLayerSettings::BelowLine );
@@ -350,7 +350,7 @@ void QgsLabelingGui::init()

// Label repeat distance
mRepeatDistanceSpinBox->setValue( lyr.repeatDistance );
mRepeatDistanceUnitWidget->setUnit( lyr.repeatDistanceUnit - 1 );
mRepeatDistanceUnitWidget->setUnit( lyr.repeatDistanceUnit ? QgsSymbolV2::MapUnit : QgsSymbolV2::MM );
mRepeatDistanceUnitWidget->setMapUnitScale( lyr.repeatDistanceMapUnitScale );

mPrioritySlider->setValue( lyr.priority );
@@ -392,7 +392,7 @@ void QgsLabelingGui::init()
// buffer
mBufferDrawChkBx->setChecked( lyr.bufferDraw );
spinBufferSize->setValue( lyr.bufferSize );
mBufferUnitWidget->setUnit( lyr.bufferSizeInMapUnits ? 1 : 0 );
mBufferUnitWidget->setUnit( lyr.bufferSizeInMapUnits ? QgsSymbolV2::MapUnit : QgsSymbolV2::MM );
mBufferUnitWidget->setMapUnitScale( lyr.bufferSizeMapUnitScale );
btnBufferColor->setColor( lyr.bufferColor );
mBufferTranspSpinBox->setValue( lyr.bufferTransp );
@@ -451,15 +451,15 @@ void QgsLabelingGui::init()
mShapeSizeCmbBx->setCurrentIndex( lyr.shapeSizeType );
mShapeSizeXSpnBx->setValue( lyr.shapeSize.x() );
mShapeSizeYSpnBx->setValue( lyr.shapeSize.y() );
mShapeSizeUnitWidget->setUnit( lyr.shapeSizeUnits - 1 );
mShapeSizeUnitWidget->setUnit( lyr.shapeSizeUnits == QgsPalLayerSettings::MapUnits ? QgsSymbolV2::MapUnit : QgsSymbolV2::MM );
mShapeSizeUnitWidget->setMapUnitScale( lyr.shapeSizeMapUnitScale );
mShapeRotationCmbBx->setCurrentIndex( lyr.shapeRotationType );
mShapeRotationDblSpnBx->setEnabled( lyr.shapeRotationType != QgsPalLayerSettings::RotationSync );
mShapeRotationDDBtn->setEnabled( lyr.shapeRotationType != QgsPalLayerSettings::RotationSync );
mShapeRotationDblSpnBx->setValue( lyr.shapeRotation );
mShapeOffsetXSpnBx->setValue( lyr.shapeOffset.x() );
mShapeOffsetYSpnBx->setValue( lyr.shapeOffset.y() );
mShapeOffsetUnitWidget->setUnit( lyr.shapeOffsetUnits - 1 );
mShapeOffsetUnitWidget->setUnit( lyr.shapeOffsetUnits == QgsPalLayerSettings::MapUnits ? QgsSymbolV2::MapUnit : QgsSymbolV2::MM );
mShapeOffsetUnitWidget->setMapUnitScale( lyr.shapeOffsetMapUnitScale );
mShapeRadiusXDbSpnBx->setValue( lyr.shapeRadii.x() );
mShapeRadiusYDbSpnBx->setValue( lyr.shapeRadii.y() );
@@ -469,7 +469,7 @@ void QgsLabelingGui::init()
mShapeFillColorBtn->setColor( lyr.shapeFillColor );
mShapeBorderColorBtn->setColor( lyr.shapeBorderColor );
mShapeBorderWidthSpnBx->setValue( lyr.shapeBorderWidth );
mShapeBorderWidthUnitWidget->setUnit( lyr.shapeBorderWidthUnits - 1 );
mShapeBorderWidthUnitWidget->setUnit( lyr.shapeBorderWidthUnits == QgsPalLayerSettings::MapUnits ? QgsSymbolV2::MapUnit : QgsSymbolV2::MM );
mShapeBorderWidthUnitWidget->setMapUnitScale( lyr.shapeBorderWidthMapUnitScale );
mShapePenStyleCmbBx->setPenJoinStyle( lyr.shapeJoinStyle );

@@ -484,12 +484,12 @@ void QgsLabelingGui::init()
mShadowUnderCmbBx->setCurrentIndex( lyr.shadowUnder );
mShadowOffsetAngleSpnBx->setValue( lyr.shadowOffsetAngle );
mShadowOffsetSpnBx->setValue( lyr.shadowOffsetDist );
mShadowOffsetUnitWidget->setUnit( lyr.shadowOffsetUnits - 1 );
mShadowOffsetUnitWidget->setUnit( lyr.shadowOffsetUnits == QgsPalLayerSettings::MapUnits ? QgsSymbolV2::MapUnit : QgsSymbolV2::MM );
mShadowOffsetUnitWidget->setMapUnitScale( lyr.shadowOffsetMapUnitScale );
mShadowOffsetGlobalChkBx->setChecked( lyr.shadowOffsetGlobal );

mShadowRadiusDblSpnBx->setValue( lyr.shadowRadius );
mShadowRadiusUnitWidget->setUnit( lyr.shadowRadiusUnits - 1 );
mShadowRadiusUnitWidget->setUnit( lyr.shadowRadiusUnits == QgsPalLayerSettings::MapUnits ? QgsSymbolV2::MapUnit : QgsSymbolV2::MM );
mShadowRadiusUnitWidget->setMapUnitScale( lyr.shadowRadiusMapUnitScale );
mShadowRadiusAlphaChkBx->setChecked( lyr.shadowRadiusAlphaOnly );
mShadowTranspSpnBx->setValue( lyr.shadowTransparency );
@@ -591,7 +591,7 @@ QgsPalLayerSettings QgsLabelingGui::layerSettings()
{
lyr.placement = QgsPalLayerSettings::AroundPoint;
lyr.dist = mLineDistanceSpnBx->value();
lyr.distInMapUnits = ( mLineDistanceUnitWidget->getUnit() == 1 );
lyr.distInMapUnits = ( mLineDistanceUnitWidget->unit() == QgsSymbolV2::MapUnit );
lyr.distMapUnitScale = mLineDistanceUnitWidget->getMapUnitScale();
}
else if (( curPlacementWdgt == pagePoint && radOverPoint->isChecked() )
@@ -601,7 +601,7 @@ QgsPalLayerSettings QgsLabelingGui::layerSettings()
lyr.quadOffset = ( QgsPalLayerSettings::QuadrantPosition )mQuadrantBtnGrp->checkedId();
lyr.xOffset = mPointOffsetXSpinBox->value();
lyr.yOffset = mPointOffsetYSpinBox->value();
lyr.labelOffsetInMapUnits = ( mPointOffsetUnitWidget->getUnit() == 1 );
lyr.labelOffsetInMapUnits = ( mPointOffsetUnitWidget->unit() == QgsSymbolV2::MapUnit );
lyr.labelOffsetMapUnitScale = mPointOffsetUnitWidget->getMapUnitScale();
lyr.angleOffset = mPointAngleSpinBox->value();
}
@@ -612,7 +612,7 @@ QgsPalLayerSettings QgsLabelingGui::layerSettings()
bool curved = ( curPlacementWdgt == pageLine && radLineCurved->isChecked() );
lyr.placement = ( curved ? QgsPalLayerSettings::Curved : QgsPalLayerSettings::Line );
lyr.dist = mLineDistanceSpnBx->value();
lyr.distInMapUnits = ( mLineDistanceUnitWidget->getUnit() == 1 );
lyr.distInMapUnits = ( mLineDistanceUnitWidget->unit() == QgsSymbolV2::MapUnit );
lyr.distMapUnitScale = mLineDistanceUnitWidget->getMapUnitScale();
if ( chkLineAbove->isChecked() )
lyr.placementFlags |= QgsPalLayerSettings::AboveLine;
@@ -639,7 +639,7 @@ QgsPalLayerSettings QgsLabelingGui::layerSettings()
}

lyr.repeatDistance = mRepeatDistanceSpinBox->value();
lyr.repeatDistanceUnit = static_cast<QgsPalLayerSettings::SizeUnit>( 1 + mRepeatDistanceUnitWidget->getUnit() );
lyr.repeatDistanceUnit = mRepeatDistanceUnitWidget->unit() == QgsSymbolV2::MapUnit ? QgsPalLayerSettings::MapUnits : QgsPalLayerSettings::MM;
lyr.repeatDistanceMapUnitScale = mRepeatDistanceUnitWidget->getMapUnitScale();

lyr.textColor = btnTextColor->color();
@@ -664,7 +664,7 @@ QgsPalLayerSettings QgsLabelingGui::layerSettings()
lyr.bufferSize = spinBufferSize->value();
lyr.bufferColor = btnBufferColor->color();
lyr.bufferTransp = mBufferTranspSpinBox->value();
lyr.bufferSizeInMapUnits = ( mBufferUnitWidget->getUnit() == 1 );
lyr.bufferSizeInMapUnits = ( mBufferUnitWidget->unit() == QgsSymbolV2::MapUnit );
lyr.bufferSizeMapUnitScale = mBufferUnitWidget->getMapUnitScale();
lyr.bufferJoinStyle = mBufferJoinStyleComboBox->penJoinStyle();
lyr.bufferNoFill = !mBufferTranspFillChbx->isChecked();
@@ -677,12 +677,12 @@ QgsPalLayerSettings QgsLabelingGui::layerSettings()

lyr.shapeSizeType = ( QgsPalLayerSettings::SizeType )mShapeSizeCmbBx->currentIndex();
lyr.shapeSize = QPointF( mShapeSizeXSpnBx->value(), mShapeSizeYSpnBx->value() );
lyr.shapeSizeUnits = ( QgsPalLayerSettings::SizeUnit )( mShapeSizeUnitWidget->getUnit() + 1 );
lyr.shapeSizeUnits = mShapeSizeUnitWidget->unit() == QgsSymbolV2::MapUnit ? QgsPalLayerSettings::MapUnits : QgsPalLayerSettings::MM;
lyr.shapeSizeMapUnitScale = mShapeSizeUnitWidget->getMapUnitScale();
lyr.shapeRotationType = ( QgsPalLayerSettings::RotationType )( mShapeRotationCmbBx->currentIndex() );
lyr.shapeRotation = mShapeRotationDblSpnBx->value();
lyr.shapeOffset = QPointF( mShapeOffsetXSpnBx->value(), mShapeOffsetYSpnBx->value() );
lyr.shapeOffsetUnits = ( QgsPalLayerSettings::SizeUnit )( mShapeOffsetUnitWidget->getUnit() + 1 );
lyr.shapeOffsetUnits = mShapeOffsetUnitWidget->unit() == QgsSymbolV2::MapUnit ? QgsPalLayerSettings::MapUnits : QgsPalLayerSettings::MM;
lyr.shapeOffsetMapUnitScale = mShapeOffsetUnitWidget->getMapUnitScale();
lyr.shapeRadii = QPointF( mShapeRadiusXDbSpnBx->value(), mShapeRadiusYDbSpnBx->value() );
lyr.shapeRadiiUnits = ( QgsPalLayerSettings::SizeUnit )( mShapeRadiusUnitWidget->getUnit() + 1 );
@@ -691,7 +691,7 @@ QgsPalLayerSettings QgsLabelingGui::layerSettings()
lyr.shapeFillColor = mShapeFillColorBtn->color();
lyr.shapeBorderColor = mShapeBorderColorBtn->color();
lyr.shapeBorderWidth = mShapeBorderWidthSpnBx->value();
lyr.shapeBorderWidthUnits = ( QgsPalLayerSettings::SizeUnit )( mShapeBorderWidthUnitWidget->getUnit() + 1 );
lyr.shapeBorderWidthUnits = mShapeBorderWidthUnitWidget->unit() == QgsSymbolV2::MapUnit ? QgsPalLayerSettings::MapUnits : QgsPalLayerSettings::MM;
lyr.shapeBorderWidthMapUnitScale = mShapeBorderWidthUnitWidget->getMapUnitScale();
lyr.shapeJoinStyle = mShapePenStyleCmbBx->penJoinStyle();
lyr.shapeTransparency = mShapeTranspSpinBox->value();
@@ -702,11 +702,11 @@ QgsPalLayerSettings QgsLabelingGui::layerSettings()
lyr.shadowUnder = ( QgsPalLayerSettings::ShadowType )mShadowUnderCmbBx->currentIndex();
lyr.shadowOffsetAngle = mShadowOffsetAngleSpnBx->value();
lyr.shadowOffsetDist = mShadowOffsetSpnBx->value();
lyr.shadowOffsetUnits = ( QgsPalLayerSettings::SizeUnit )( mShadowOffsetUnitWidget->getUnit() + 1 );
lyr.shadowOffsetUnits = mShadowOffsetUnitWidget->unit() == QgsSymbolV2::MapUnit ? QgsPalLayerSettings::MapUnits : QgsPalLayerSettings::MM;
lyr.shadowOffsetMapUnitScale = mShadowOffsetUnitWidget->getMapUnitScale();
lyr.shadowOffsetGlobal = mShadowOffsetGlobalChkBx->isChecked();
lyr.shadowRadius = mShadowRadiusDblSpnBx->value();
lyr.shadowRadiusUnits = ( QgsPalLayerSettings::SizeUnit )( mShadowRadiusUnitWidget->getUnit() + 1 );
lyr.shadowRadiusUnits = mShadowRadiusUnitWidget->unit() == QgsSymbolV2::MapUnit ? QgsPalLayerSettings::MapUnits : QgsPalLayerSettings::MM;
lyr.shadowRadiusMapUnitScale = mShadowRadiusUnitWidget->getMapUnitScale();
lyr.shadowRadiusAlphaOnly = mShadowRadiusAlphaChkBx->isChecked();
lyr.shadowTransparency = mShadowTranspSpnBx->value();
@@ -1182,7 +1182,7 @@ void QgsLabelingGui::updatePreview()

if ( mBufferDrawChkBx->isChecked() )
{
if ( mBufferUnitWidget->getUnit() == 1 ) // map units
if ( mBufferUnitWidget->unit() == QgsSymbolV2::MapUnit )
{
bufferSize = previewRatio * spinBufferSize->value() / 3.527;
}
@@ -1202,7 +1202,7 @@ void QgsLabelingGui::updatePreview()

if ( mBufferDrawChkBx->isChecked() )
{
if ( mBufferUnitWidget->getUnit() == 0 ) // millimeters
if ( mBufferUnitWidget->unit() == QgsSymbolV2::MM )
{
bufferSize = spinBufferSize->value();
}
@@ -52,6 +52,8 @@ class CORE_EXPORT QgsSymbolV2
Pixel
};

typedef QList<OutputUnit> OutputUnitList;

enum SymbolType
{
Marker,
@@ -93,13 +93,57 @@ void QgsUnitSelectionWidget::setUnits( const QStringList &units, int mapUnitIdx
blockSignals( false );
}

void QgsUnitSelectionWidget::setUnits( const QgsSymbolV2::OutputUnitList &units )
{
blockSignals( true );
mUnitCombo->clear();

//instead of iterating over the units list, we specifically check for presence of unit types
//to ensure that the widget always keeps the same order for units, regardless of the
//order specified in the units list
mMapUnitIdx = -1;
if ( units.contains( QgsSymbolV2::MM ) )
{
mUnitCombo->addItem( tr( "Millimeter" ), QgsSymbolV2::MM );
}
if ( units.contains( QgsSymbolV2::Pixel ) )
{
mUnitCombo->addItem( tr( "Pixels" ), QgsSymbolV2::Pixel );
}
if ( units.contains( QgsSymbolV2::MapUnit ) )
{
mUnitCombo->addItem( tr( "Map unit" ), QgsSymbolV2::MapUnit );
}
blockSignals( false );
}

QgsSymbolV2::OutputUnit QgsUnitSelectionWidget::unit() const
{
if ( mUnitCombo->count() == 0 )
return QgsSymbolV2::Mixed;

QVariant currentData = mUnitCombo->itemData( mUnitCombo->currentIndex() );
if ( currentData.isValid() )
{
return ( QgsSymbolV2::OutputUnit ) currentData.toInt();
}
//unknown
return QgsSymbolV2::Mixed;
}

void QgsUnitSelectionWidget::setUnit( int unitIndex )
{
blockSignals( true );
mUnitCombo->setCurrentIndex( unitIndex );
blockSignals( false );
}

void QgsUnitSelectionWidget::setUnit( QgsSymbolV2::OutputUnit unit )
{
int idx = mUnitCombo->findData( QVariant(( int ) unit ) );
mUnitCombo->setCurrentIndex( idx == -1 ? 0 : idx );
}

void QgsUnitSelectionWidget::showDialog()
{
QgsMapUnitScale scale = mUnitScaleDialog->getMapUnitScale();
@@ -119,8 +163,13 @@ void QgsUnitSelectionWidget::showDialog()

void QgsUnitSelectionWidget::toggleUnitRangeButton()
{
mMapScaleButton->setVisible( mMapUnitIdx != -1 && mUnitCombo->currentIndex() == mMapUnitIdx );
if ( unit() != QgsSymbolV2::Mixed )
{
mMapScaleButton->setVisible( unit() == QgsSymbolV2::MapUnit );
}
else
{
mMapScaleButton->setVisible( mMapUnitIdx != -1 && mUnitCombo->currentIndex() == mMapUnitIdx );
}
}



@@ -23,7 +23,6 @@
#include "ui_qgsunitselectionwidget.h"
#include "ui_qgsmapunitscaledialog.h"


/** Dialog allowing the user to choose the minimum and maximum scale of an object in map units */
class GUI_EXPORT QgsMapUnitScaleDialog : public QDialog, private Ui::QgsMapUnitScaleDialog
{
@@ -55,15 +54,40 @@ class GUI_EXPORT QgsUnitSelectionWidget : public QWidget, private Ui::QgsUnitSel
public:
QgsUnitSelectionWidget( QWidget* parent = 0 );

/** Sets the units which the user can choose from in the combobox. mapUnitIdx specifies which entry corresponds to the map units, or -1 if none */
/** Sets the units which the user can choose from in the combobox.
* @param units list of strings for custom units to display in the widget
* @param mapUnitIdx specifies which entry corresponds to the map units, or -1 if none
*/
void setUnits( const QStringList& units, int mapUnitIdx );

/** Sets the units which the user can choose from in the combobox. Clears any existing units.
* @param units list of valid units
* @note added in QGIS 2.9
*/
void setUnits( const QgsSymbolV2::OutputUnitList& units );

/** Get the selected unit index */
int getUnit() const { return mUnitCombo->currentIndex(); }
/** Sets the selected unit index */

/** Returns the current predefined selected unit (if applicable).
* @returns selected output unit, or QgsSymbolV2::Mixed if the widget was populated with custom unit types
* @note added in QGIS 2.9
*/
QgsSymbolV2::OutputUnit unit() const;

/** Sets the selected unit index
* @param unitIndex index of unit to set as current
*/
void setUnit( int unitIndex );

/** Sets the selected unit
* @param unit predefined unit to set as current
*/
void setUnit( QgsSymbolV2::OutputUnit unit );

/** Returns the map unit scale */
QgsMapUnitScale getMapUnitScale() const { return mUnitScaleDialog->getMapUnitScale(); }

/** Sets the map unit scale */
void setMapUnitScale( const QgsMapUnitScale& scale ) { mUnitScaleDialog->setMapUnitScale( scale ); }

0 comments on commit 0d241b7

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