]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Multi column support for Object browser
authorstv <stv@opencascade.com>
Tue, 7 Jun 2005 05:36:39 +0000 (05:36 +0000)
committerstv <stv@opencascade.com>
Tue, 7 Jun 2005 05:36:39 +0000 (05:36 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h
src/SalomeApp/SalomeApp_DataObject.cxx

index f33c25e2e0f2c6d66d54f12ed664cc5f5f4c2e8d..1a441fd102911c967d887e33c38dd314c6649a3e 100644 (file)
@@ -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 )
index 8617be9c9d916e4eb8a41df33ddb2b9072756582..587d5a2d0f6f8ab6049985f4efc48c62eb1170ba 100644 (file)
@@ -100,6 +100,7 @@ public slots:
 
 private slots:
   void                                onSelection();
+  void                                onAboutRefresh();
 
 protected:
   virtual void                        createActions();
index 0a1bbe819675ac3bd0c54f70f630288417af17bd..b1a21c8f6c2451c0c203c7b481d965df743d0fa7 100644 (file)
@@ -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 );
       }
     }