mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-09 00:35:20 -05:00
[ui] Fix color ramp shader widget auto label function
This commit is contained in:
parent
5135c0e60a
commit
30cee81fa7
@ -257,7 +257,6 @@ void QgsColorRampShaderWidget::setUnitFromLabels()
|
|||||||
{
|
{
|
||||||
mUnitLineEdit->setText( unit );
|
mUnitLineEdit->setText( unit );
|
||||||
}
|
}
|
||||||
autoLabel();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -327,7 +326,7 @@ void QgsColorRampShaderWidget::classify()
|
|||||||
QgsTreeWidgetItemObject *newItem = new QgsTreeWidgetItemObject( mColormapTreeWidget );
|
QgsTreeWidgetItemObject *newItem = new QgsTreeWidgetItemObject( mColormapTreeWidget );
|
||||||
newItem->setText( ValueColumn, QString::number( it->value, 'g', 15 ) );
|
newItem->setText( ValueColumn, QString::number( it->value, 'g', 15 ) );
|
||||||
newItem->setData( ColorColumn, Qt::EditRole, it->color );
|
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 );
|
newItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable );
|
||||||
connect( newItem, &QgsTreeWidgetItemObject::itemEdited,
|
connect( newItem, &QgsTreeWidgetItemObject::itemEdited,
|
||||||
this, &QgsColorRampShaderWidget::mColormapTreeWidget_itemEdited );
|
this, &QgsColorRampShaderWidget::mColormapTreeWidget_itemEdited );
|
||||||
@ -409,8 +408,6 @@ void QgsColorRampShaderWidget::populateColormapTreeWidget( const QList<QgsColorR
|
|||||||
this, &QgsColorRampShaderWidget::mColormapTreeWidget_itemEdited );
|
this, &QgsColorRampShaderWidget::mColormapTreeWidget_itemEdited );
|
||||||
}
|
}
|
||||||
setUnitFromLabels();
|
setUnitFromLabels();
|
||||||
|
|
||||||
autoLabel();
|
|
||||||
emit widgetChanged();
|
emit widgetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -671,6 +668,7 @@ void QgsColorRampShaderWidget::setFromShader( const QgsColorRampShader &colorRam
|
|||||||
this, &QgsColorRampShaderWidget::mColormapTreeWidget_itemEdited );
|
this, &QgsColorRampShaderWidget::mColormapTreeWidget_itemEdited );
|
||||||
}
|
}
|
||||||
setUnitFromLabels();
|
setUnitFromLabels();
|
||||||
|
|
||||||
mClipCheckBox->setChecked( colorRampShader.clip() );
|
mClipCheckBox->setChecked( colorRampShader.clip() );
|
||||||
mClassificationModeComboBox->setCurrentIndex( mClassificationModeComboBox->findData( colorRampShader.classificationMode() ) );
|
mClassificationModeComboBox->setCurrentIndex( mClassificationModeComboBox->findData( colorRampShader.classificationMode() ) );
|
||||||
mNumberOfEntriesSpinBox->setValue( colorRampShader.colorRampItemList().count() ); // some default
|
mNumberOfEntriesSpinBox->setValue( colorRampShader.colorRampItemList().count() ); // some default
|
||||||
|
Loading…
x
Reference in New Issue
Block a user