From 7063498856b950595d3ab452f9e87ec5a71f2295 Mon Sep 17 00:00:00 2001 From: stv Date: Tue, 7 Jun 2005 07:53:10 +0000 Subject: [PATCH] References in object browser --- src/Qtx/QtxListView.cxx | 6 ++++-- src/SalomeApp/SalomeApp_DataModel.cxx | 9 +++++---- src/SalomeApp/SalomeApp_DataObject.cxx | 7 +++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Qtx/QtxListView.cxx b/src/Qtx/QtxListView.cxx index e009ea3b2..e00dc39ef 100755 --- a/src/Qtx/QtxListView.cxx +++ b/src/Qtx/QtxListView.cxx @@ -176,10 +176,12 @@ void QtxListView::setShown( int ind, bool sh ) } else { - data.width = columnWidth( ind ); - data.resizeable = header()->isResizeEnabled( ind ); + int w = columnWidth( ind ); + bool r = header()->isResizeEnabled( ind ); setColumnWidth( ind, 0 ); header()->setResizeEnabled( false, ind ); + data.width = w; + data.resizeable = r; } updateContents(); } diff --git a/src/SalomeApp/SalomeApp_DataModel.cxx b/src/SalomeApp/SalomeApp_DataModel.cxx index 0340c6844..c995ffb87 100644 --- a/src/SalomeApp/SalomeApp_DataModel.cxx +++ b/src/SalomeApp/SalomeApp_DataModel.cxx @@ -35,9 +35,10 @@ SUIT_DataObject* SalomeApp_DataModel::BuildTree( const _PTR(SObject)& obj, if ( !obj || !study ) return aDataObj; - if ( obj->GetName().size() ) { // skip nameless SObjects - _PTR(SComponent) aSComp ( obj ); - + _PTR(SObject) refObj; + if ( obj->GetName().size() || obj->ReferencedObject( refObj ) ) // skip nameless non references SObjects + { + _PTR(SComponent) aSComp( obj ); aDataObj = aSComp ? new SalomeApp_ModuleObject( aSComp, parent ) : new SalomeApp_DataObject ( obj, parent ); @@ -45,7 +46,7 @@ SUIT_DataObject* SalomeApp_DataModel::BuildTree( const _PTR(SObject)& obj, for ( ; it->More();it->Next() ) { // don't use shared_ptr here, for Data Object will take // ownership of this pointer - _PTR(SObject) aSO ( it->Value() ); + _PTR(SObject) aSO( it->Value() ); BuildTree( aSO, aDataObj, study ); } } diff --git a/src/SalomeApp/SalomeApp_DataObject.cxx b/src/SalomeApp/SalomeApp_DataObject.cxx index b1a21c8f6..e1937ceb9 100644 --- a/src/SalomeApp/SalomeApp_DataObject.cxx +++ b/src/SalomeApp/SalomeApp_DataObject.cxx @@ -95,6 +95,13 @@ QString SalomeApp_DataObject::name() const 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; -- 2.39.2