Skip to content

Commit

Permalink
[ui] Fix color ramp shader widget auto label function
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jun 24, 2019
1 parent dfc157e commit 7223d71
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/gui/raster/qgscolorrampshaderwidget.cpp
Expand Up @@ -257,7 +257,6 @@ void QgsColorRampShaderWidget::setUnitFromLabels()
{
mUnitLineEdit->setText( unit );
}
autoLabel();
}


Expand Down Expand Up @@ -326,7 +325,7 @@ void QgsColorRampShaderWidget::classify()
QgsTreeWidgetItemObject *newItem = new QgsTreeWidgetItemObject( mColormapTreeWidget );
newItem->setText( ValueColumn, QString::number( it->value, 'g', 15 ) );
newItem->setData( ColorColumn, Qt::EditRole, it->color );
newItem->setText( LabelColumn, it->label );
newItem->setText( LabelColumn, QString() ); // Labels will be populated in autoLabel()
newItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable );
connect( newItem, &QgsTreeWidgetItemObject::itemEdited,
this, &QgsColorRampShaderWidget::mColormapTreeWidget_itemEdited );
Expand Down Expand Up @@ -408,8 +407,6 @@ void QgsColorRampShaderWidget::populateColormapTreeWidget( const QList<QgsColorR
this, &QgsColorRampShaderWidget::mColormapTreeWidget_itemEdited );
}
setUnitFromLabels();

autoLabel();
emit widgetChanged();
}

Expand Down Expand Up @@ -670,6 +667,7 @@ void QgsColorRampShaderWidget::setFromShader( const QgsColorRampShader &colorRam
this, &QgsColorRampShaderWidget::mColormapTreeWidget_itemEdited );
}
setUnitFromLabels();

mClipCheckBox->setChecked( colorRampShader.clip() );
mClassificationModeComboBox->setCurrentIndex( mClassificationModeComboBox->findData( colorRampShader.classificationMode() ) );
mNumberOfEntriesSpinBox->setValue( colorRampShader.colorRampItemList().count() ); // some default
Expand Down

0 comments on commit 7223d71

Please sign in to comment.