Skip to content
Permalink
Browse files

Some UI tweaks to graduated renderer widget

  • Loading branch information
nyalldawson committed Apr 11, 2015
1 parent 66d55da commit 0405a65e592e307962afa96508dc873786713481
@@ -419,6 +419,7 @@ QgsGraduatedSymbolRendererV2Widget::QgsGraduatedSymbolRendererV2Widget( QgsVecto

mGraduatedSymbol = QgsSymbolV2::defaultSymbol( mLayer->geometryType() );

methodComboBox->blockSignals( true );
methodComboBox->addItem( "Color" );
if ( mGraduatedSymbol->type() == QgsSymbolV2::Marker )
{
@@ -432,6 +433,7 @@ QgsGraduatedSymbolRendererV2Widget::QgsGraduatedSymbolRendererV2Widget( QgsVecto
minSizeSpinBox->setValue( .1 );
maxSizeSpinBox->setValue( 2 );
}
methodComboBox->blockSignals( false );

connect( mExpressionWidget, SIGNAL( fieldChanged( QString ) ), this, SLOT( graduatedColumnChanged( QString ) ) );
connect( viewGraduated, SIGNAL( doubleClicked( const QModelIndex & ) ), this, SLOT( rangesDoubleClicked( const QModelIndex & ) ) );
@@ -447,8 +449,6 @@ QgsGraduatedSymbolRendererV2Widget::QgsGraduatedSymbolRendererV2Widget( QgsVecto

connect( mSizeUnitWidget, SIGNAL( changed() ), this, SLOT( on_mSizeUnitWidget_changed() ) );

connect( methodComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( on_methodComboBox_currentChanged( int ) ) );

connectUpdateHandlers();

// initialize from previously set renderer
@@ -564,6 +564,7 @@ void QgsGraduatedSymbolRendererV2Widget::updateUiFromRenderer( bool updateCount
}

// set source color ramp
methodComboBox->blockSignals( true );
if ( mRenderer->graduatedMethod() == QgsGraduatedSymbolRendererV2::GraduatedColor )
{
methodComboBox->setCurrentIndex( 0 );
@@ -580,6 +581,8 @@ void QgsGraduatedSymbolRendererV2Widget::updateUiFromRenderer( bool updateCount
maxSizeSpinBox->setValue( mRenderer->maxSymbolSize() );
}
}
mMethodStackedWidget->setCurrentIndex( methodComboBox->currentIndex() );
methodComboBox->blockSignals( false );

QgsRendererRangeV2LabelFormat labelFormat = mRenderer->labelFormat();
txtLegendFormat->setText( labelFormat.format() );
@@ -598,9 +601,9 @@ void QgsGraduatedSymbolRendererV2Widget::graduatedColumnChanged( QString field )
mRenderer->setClassAttribute( field );
}

void QgsGraduatedSymbolRendererV2Widget::on_methodComboBox_currentChanged( int idx )
void QgsGraduatedSymbolRendererV2Widget::on_methodComboBox_currentIndexChanged( int idx )
{
stackedWidget->setCurrentIndex( idx );
mMethodStackedWidget->setCurrentIndex( idx );
if ( idx == 0 )
{
mRenderer->setGraduatedMethod( QgsGraduatedSymbolRendererV2::GraduatedColor );
@@ -110,7 +110,7 @@ class GUI_EXPORT QgsGraduatedSymbolRendererV2Widget : public QgsRendererV2Widget
void rowsMoved();
void modelDataChanged();
void on_mSizeUnitWidget_changed();
void on_methodComboBox_currentChanged( int );
void on_methodComboBox_currentIndexChanged( int );

protected:
void updateUiFromRenderer( bool updateCount = true );

0 comments on commit 0405a65

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