Skip to content

Commit

Permalink
Add distance parameter for point displacement to the gui
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13147 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Mar 23, 2010
1 parent 68d71f1 commit 8114089
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
Expand Up @@ -58,6 +58,7 @@ QgsFeatureRendererV2* QgsPointDisplacementRenderer::clone()
r->setLabelColor( mLabelColor );
r->setCircleRadiusAddition( mCircleRadiusAddition );
r->setMaxLabelScaleDenominator( mMaxLabelScaleDenominator );
r->setTolerance( mTolerance );
if ( mCenterSymbol )
{
r->setCenterSymbol( dynamic_cast<QgsMarkerSymbolV2*>( mCenterSymbol->clone() ) );
Expand Down
Expand Up @@ -98,6 +98,7 @@ QgsPointDisplacementRendererWidget::QgsPointDisplacementRendererWidget( QgsVecto
mCircleColorButton->setColor( mRenderer->circleColor() );
mLabelColorButton->setColor( mRenderer->labelColor() );
mCircleModificationSpinBox->setValue( mRenderer->circleRadiusAddition() );
mDistanceSpinBox->setValue( mRenderer->tolerance() );

//scale dependent labelling
mMaxScaleDenominatorEdit->setText( QString::number( mRenderer->maxLabelScaleDenominator() ) );
Expand Down Expand Up @@ -265,6 +266,14 @@ void QgsPointDisplacementRendererWidget::on_mCircleModificationSpinBox_valueChan
mRenderer->setCircleRadiusAddition( d );
}

void QgsPointDisplacementRendererWidget::on_mDistanceSpinBox_valueChanged( double d )
{
if ( mRenderer )
{
mRenderer->setTolerance( d );
}
}

void QgsPointDisplacementRendererWidget::on_mScaleDependentLabelsCheckBox_stateChanged( int state )
{
if ( state == Qt::Unchecked )
Expand Down Expand Up @@ -305,6 +314,7 @@ void QgsPointDisplacementRendererWidget::blockAllSignals( bool block )
mScaleDependentLabelsCheckBox->blockSignals( block );
mMaxScaleDenominatorEdit->blockSignals( block );
mCenterSymbolPushButton->blockSignals( block );
mDistanceSpinBox->blockSignals( block );
}

void QgsPointDisplacementRendererWidget::on_mCenterSymbolPushButton_clicked()
Expand Down
Expand Up @@ -47,6 +47,7 @@ class QgsPointDisplacementRendererWidget: public QgsRendererV2Widget, private Ui
void on_mLabelFontButton_clicked();
void on_mCircleWidthSpinBox_valueChanged( double d );
void on_mCircleColorButton_clicked();
void on_mDistanceSpinBox_valueChanged( double d );
void on_mLabelColorButton_clicked();
void on_mCircleModificationSpinBox_valueChanged( double d );
void on_mScaleDependentLabelsCheckBox_stateChanged( int state );
Expand Down
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>328</width>
<height>469</height>
<width>327</width>
<height>505</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -115,6 +115,27 @@
</item>
</layout>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLabel" name="mDistanceToleranceLabel">
<property name="text">
<string>Point distance tolerance:</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="mDistanceSpinBox">
<property name="decimals">
<number>7</number>
</property>
<property name="maximum">
<double>9999.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
Expand Down

0 comments on commit 8114089

Please sign in to comment.