From 13dc2438cd79b53fdd067ec56fb7c464b4a00303 Mon Sep 17 00:00:00 2001 From: stv Date: Tue, 7 Jun 2005 05:36:39 +0000 Subject: [PATCH] Multi column support for Object browser --- src/SalomeApp/SalomeApp_Application.cxx | 16 ++++++++++++++++ src/SalomeApp/SalomeApp_Application.h | 1 + src/SalomeApp/SalomeApp_DataObject.cxx | 5 +++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index f33c25e2e..1a441fd10 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -10,6 +10,7 @@ #include "SalomeApp_Study.h" #include "SalomeApp_Module.h" #include "SalomeApp_OBFilter.h" +#include "SalomeApp_DataModel.h" #include "SalomeApp_DataObject.h" #include "SalomeApp_EventFilter.h" #include "SalomeApp_WidgetContainer.h" @@ -462,6 +463,20 @@ void SalomeApp_Application::onSelectionChanged() { } +void SalomeApp_Application::onAboutRefresh() +{ + SalomeApp_DataModel* dm = 0; + if ( activeModule() ) + { + CAM_DataModel* camDM = activeModule()->dataModel(); + if ( camDM && camDM->inherits( "SalomeApp_DataModel" ) ) + dm = (SalomeApp_DataModel*)camDM; + } + + if ( dm ) + dm->update(); +} + void SalomeApp_Application::setActiveStudy( SUIT_Study* study ) { CAM_Application::setActiveStudy( study ); @@ -779,6 +794,7 @@ QWidget* SalomeApp_Application::createWindow( const int flag ) wid = ob; + connect( ob, SIGNAL( aboutRefresh() ), this, SLOT( onAboutRefresh() ) ); ob->connectPopupRequest( this, SLOT( onConnectPopupRequest( SUIT_PopupClient*, QContextMenuEvent* ) ) ); } else if ( flag == WT_PyConsole ) diff --git a/src/SalomeApp/SalomeApp_Application.h b/src/SalomeApp/SalomeApp_Application.h index 8617be9c9..587d5a2d0 100644 --- a/src/SalomeApp/SalomeApp_Application.h +++ b/src/SalomeApp/SalomeApp_Application.h @@ -100,6 +100,7 @@ public slots: private slots: void onSelection(); + void onAboutRefresh(); protected: virtual void createActions(); diff --git a/src/SalomeApp/SalomeApp_DataObject.cxx b/src/SalomeApp/SalomeApp_DataObject.cxx index 0a1bbe819..b1a21c8f6 100644 --- a/src/SalomeApp/SalomeApp_DataObject.cxx +++ b/src/SalomeApp/SalomeApp_DataObject.cxx @@ -159,11 +159,12 @@ QColor SalomeApp_DataObject::color( const ColorRole cr ) const switch ( cr ) { case Foreground: + 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 ); } } -- 2.39.2