Add color icon to RimColorLegendItem in project tree.

This commit is contained in:
Kristian Bendiksen authored and Magne Sjaastad committed 2020-05-08 11:19:31 +02:00
1 parent db384ea754
commit 368de8491e
2 files changed
+14 -1

No files matched your search

@@ -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 );
}