Skip to content
Permalink
Browse files

Fix missing map units in vector field widget

  • Loading branch information
nyalldawson committed May 7, 2015
1 parent 45bdae4 commit c9897ab29f24ef5eee96d50d62ad5820455c3558
@@ -19,6 +19,9 @@
QgsVectorFieldSymbolLayerWidget::QgsVectorFieldSymbolLayerWidget( const QgsVectorLayer* vl, QWidget* parent ): QgsSymbolLayerV2Widget( parent, vl ), mLayer( 0 )
{
setupUi( this );

mDistanceUnitWidget->setUnits( QgsSymbolV2::OutputUnitList() << QgsSymbolV2::MM << QgsSymbolV2::MapUnit );

if ( mVectorLayer )
{
const QgsFields& fm = mVectorLayer->pendingFields();
@@ -201,13 +204,17 @@ void QgsVectorFieldSymbolLayerWidget::on_mCounterclockwiseFromEastRadioButton_to
}
}

void QgsVectorFieldSymbolLayerWidget::on_mDistanceUnitComboBox_currentIndexChanged( int index )
void QgsVectorFieldSymbolLayerWidget::on_mDistanceUnitWidget_changed()
{
if ( mLayer )
if ( !mLayer )
{
mLayer->setDistanceUnit(( QgsSymbolV2::OutputUnit ) index );
emit changed();
return;
}

mLayer->setDistanceUnit( mDistanceUnitWidget->unit() );
mLayer->setDistanceMapUnitScale( mDistanceUnitWidget->getMapUnitScale() );
emit changed();
}



@@ -47,7 +47,7 @@ class GUI_EXPORT QgsVectorFieldSymbolLayerWidget: public QgsSymbolLayerV2Widget,
void on_mRadiansRadioButton_toggled( bool checked );
void on_mClockwiseFromNorthRadioButton_toggled( bool checked );
void on_mCounterclockwiseFromEastRadioButton_toggled( bool checked );
void on_mDistanceUnitComboBox_currentIndexChanged( int index );
void on_mDistanceUnitWidget_changed();
};

#endif // QGSVECTORFIELDSYMBOLLAYERWIDGET_H
@@ -14,7 +14,16 @@
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<property name="leftMargin">
<number>1</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>1</number>
</property>
<property name="bottomMargin">
<number>1</number>
</property>
<item>
@@ -108,10 +117,19 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="maximum">
<double>9999999.000000000000000</double>
</property>
<property name="singleStep">
<double>0.200000000000000</double>
</property>
<property name="showClearButton">
<property name="value">
<double>1.000000000000000</double>
</property>
<property name="showClearButton" stdset="0">
<bool>false</bool>
</property>
</widget>

0 comments on commit c9897ab

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