Salome HOME
Property "isOpen" property added.
authorstv <stv@opencascade.com>
Fri, 10 Jun 2005 05:09:21 +0000 (05:09 +0000)
committerstv <stv@opencascade.com>
Fri, 10 Jun 2005 05:09:21 +0000 (05:09 +0000)
src/ObjBrowser/OB_Browser.cxx
src/SUIT/SUIT_DataObject.cxx
src/SUIT/SUIT_DataObject.h

index ddd557cd35274a1e867f5f8075e9ef64f7c6dfe0..2ffae850798e2e1aa8051e6df7f3f58f5341b41f 100755 (executable)
@@ -623,6 +623,9 @@ QListViewItem* OB_Browser::createTree( const SUIT_DataObject* obj,
   for ( DataObjectListIterator it ( lst ); it.current(); ++it )
     createTree( it.current(), item );
 
+  if ( item )
+    item->setOpen( obj->isOpen() );
+
   return item;
 }
 
@@ -1077,7 +1080,7 @@ void OB_Browser::openBranch( QListViewItem* item, const int level )
   item->setOpen( true );
   while ( item )
   {
-    openBranch( item, level - 1 );
+    openBranch( item->firstChild(), level - 1 );
     item = item->nextSibling();
   }
 }
index 8aa0b0a0c708b2581bc6b24ca7f6cf5d670f1c64..c4f31bb0e0cc4c64f4b47e1a9a1201eb4295ced0 100755 (executable)
@@ -13,6 +13,7 @@
 SUIT_DataObject::SUIT_DataObject( SUIT_DataObject* p )
 : myParent( 0 ),
   mySignal( 0 ),
+  myOpen( false ),
   myCheck( false )
 {
   myChildren.setAutoDelete( true );
@@ -428,6 +429,16 @@ void SUIT_DataObject::setOn( const bool on )
   myCheck = on;
 }
 
+bool SUIT_DataObject::isOpen() const
+{
+  return myOpen;
+}
+
+void SUIT_DataObject::setOpen( const bool on )
+{
+  myOpen = on;
+}
+
 /*!
     Returns object personal indentification key.
 */
index f303d0dea2df5ca460f7870492be1b67cd028f1a..cc4cf374c42e06c3cdfa62a8d3a8bf3c0132969b 100755 (executable)
@@ -71,6 +71,9 @@ public:
   virtual bool                isOn() const;
   virtual void                setOn( const bool );
 
+  virtual bool                isOpen() const;
+  virtual void                setOpen( const bool );
+
   virtual SUIT_DataObjectKey* key() const;
 
   bool                        connect( QObject*, const char* );
@@ -81,6 +84,7 @@ public:
   void                        dump( const int indent = 2 ) const; // dump to cout
 
 private:
+  bool                        myOpen;
   bool                        myCheck;
   Signal*                     mySignal;
   SUIT_DataObject*            myParent;