mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add color icon to RimColorLegendItem in project tree.
This commit is contained in:
parent
db384ea754
commit
368de8491e
@ -108,3 +108,15 @@ QString RimColorLegendItem::extractColorItemName() const
|
||||
{
|
||||
return QString( "%1" ).arg( m_categoryValue, 2, 10, QChar( '0' ) ) + " " + m_categoryName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimColorLegendItem::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ )
|
||||
{
|
||||
QColor qcolor( m_color().rByte(), m_color().gByte(), m_color().bByte() );
|
||||
|
||||
caf::QIconProvider iconProvider = this->uiIconProvider();
|
||||
iconProvider.setBackgroundColor( qcolor );
|
||||
this->setUiIcon( iconProvider );
|
||||
}
|
||||
|
@ -47,7 +47,8 @@ public:
|
||||
int categoryValue() const;
|
||||
|
||||
public:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/ ) override;
|
||||
caf::PdmFieldHandle* userDescriptionField() override;
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user