Skip to content

Commit

Permalink
Fixed #2422
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12939 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Feb 12, 2010
1 parent 624edb9 commit 1722a0f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void QgsCategorizedSymbolRendererV2Widget::populateColorRamps()

void QgsCategorizedSymbolRendererV2Widget::categoryColumnChanged()
{
deleteAllCategories();
mRenderer->setClassAttribute( cboCategorizedColumn->currentText() );
}

void QgsCategorizedSymbolRendererV2Widget::categoriesDoubleClicked( const QModelIndex & idx )
Expand Down
10 changes: 8 additions & 2 deletions src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ QgsGraduatedSymbolRendererV2Widget::QgsGraduatedSymbolRendererV2Widget( QgsVecto

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

connect( cboGraduatedColumn, SIGNAL( currentIndexChanged( int ) ), this, SLOT( graduatedColumnChanged() ) );
connect( viewGraduated, SIGNAL( doubleClicked( const QModelIndex & ) ), this, SLOT( rangesDoubleClicked( const QModelIndex & ) ) );
connect( viewGraduated, SIGNAL( clicked( const QModelIndex & ) ), this, SLOT( rangesClicked( const QModelIndex & ) ) );
connect( mg, SIGNAL( itemChanged( QStandardItem * ) ), this, SLOT( changeCurrentValue( QStandardItem * ) ) );
Expand Down Expand Up @@ -92,11 +93,11 @@ void QgsGraduatedSymbolRendererV2Widget::updateUiFromRenderer()
spinGraduatedClasses->setValue( mRenderer->ranges().count() );

// set column
//disconnect(cboGraduatedColumn, SIGNAL(currentIndexChanged(int)), this, SLOT(graduatedColumnChanged()));
disconnect( cboGraduatedColumn, SIGNAL( currentIndexChanged( int ) ), this, SLOT( graduatedColumnChanged() ) );
QString attrName = mRenderer->classAttribute();
int idx = cboGraduatedColumn->findText( attrName, Qt::MatchExactly );
cboGraduatedColumn->setCurrentIndex( idx >= 0 ? idx : 0 );
//connect(cboGraduatedColumn, SIGNAL(currentIndexChanged(int)), this, SLOT(graduatedColumnChanged()));
connect( cboGraduatedColumn, SIGNAL( currentIndexChanged( int ) ), this, SLOT( graduatedColumnChanged() ) );

// set source symbol
if ( mRenderer->sourceSymbol() )
Expand Down Expand Up @@ -134,6 +135,11 @@ void QgsGraduatedSymbolRendererV2Widget::populateColumns()
}
}

void QgsGraduatedSymbolRendererV2Widget::graduatedColumnChanged()
{
mRenderer->setClassAttribute( cboGraduatedColumn->currentText() );
}


void QgsGraduatedSymbolRendererV2Widget::populateColorRamps()
{
Expand Down
1 change: 1 addition & 0 deletions src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class GUI_EXPORT QgsGraduatedSymbolRendererV2Widget : public QgsRendererV2Widget

public slots:
void changeGraduatedSymbol();
void graduatedColumnChanged();
void classifyGraduated();
void rangesDoubleClicked( const QModelIndex & idx );
void rangesClicked( const QModelIndex & idx );
Expand Down

0 comments on commit 1722a0f

Please sign in to comment.