if ( myObject )
str = myObject->GetName().c_str();
+ if ( str.isEmpty() )
+ {
+ _PTR(SObject) refObj = referencedObject();
+ if ( refObj )
+ str = refObj->GetName().c_str();
+ }
+
if ( isReference() )
str = QString( "* " ) + str;
QString pixmapName = QObject::tr( aPixAttr->GetPixMap().c_str() );
SalomeApp_RootObject* aRoot = dynamic_cast<SalomeApp_RootObject*>( root() );
if ( aRoot && aRoot->study() ) {
- QPixmap pixmap = aRoot->study()->application()->resourceMgr()->loadPixmap( componentDataType(), pixmapName );
+ QPixmap pixmap = aRoot->study()->application()->resourceMgr()->loadPixmap( componentDataType(), pixmapName, false );
return pixmap;
}
}
return QPixmap();
}
-QColor SalomeApp_DataObject::color() const
-{
- _PTR(GenericAttribute) anAttr;
- if ( myObject && myObject->FindAttribute( anAttr, "AttributeTextColor" ) )
- {
- _PTR(AttributeTextColor) aColAttr( anAttr );
- QColor color( (int)aColAttr->TextColor().R, (int)aColAttr->TextColor().G, (int)aColAttr->TextColor().B );
- return color;
- }
- return QColor();
-}
-
QString SalomeApp_DataObject::text( const int id ) const
{
QString txt;
QColor clr;
switch ( cr )
{
- case Foreground:
+ case Text:
+ if ( isReference() )
+ clr = QColor( 255, 0, 0 );
+ else if ( myObject )
{
_PTR(GenericAttribute) anAttr;
- if ( myObject && myObject->FindAttribute( anAttr, "AttributeTextColor" ) )
+ if ( myObject->FindAttribute( anAttr, "AttributeTextColor" ) )
{
- _PTR(AttributeTextColor) aColAttr( anAttr );
+ _PTR(AttributeTextColor) aColAttr = anAttr;
clr = QColor( (int)aColAttr->TextColor().R, (int)aColAttr->TextColor().G, (int)aColAttr->TextColor().B );
}
}