From 95185846bd242ec044cb539f4871487ad0dd32b6 Mon Sep 17 00:00:00 2001 From: stv Date: Fri, 10 Jun 2005 05:09:21 +0000 Subject: [PATCH] Property "isOpen" property added. --- src/ObjBrowser/OB_Browser.cxx | 5 ++++- src/SUIT/SUIT_DataObject.cxx | 11 +++++++++++ src/SUIT/SUIT_DataObject.h | 4 ++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/ObjBrowser/OB_Browser.cxx b/src/ObjBrowser/OB_Browser.cxx index ddd557cd3..2ffae8507 100755 --- a/src/ObjBrowser/OB_Browser.cxx +++ b/src/ObjBrowser/OB_Browser.cxx @@ -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(); } } diff --git a/src/SUIT/SUIT_DataObject.cxx b/src/SUIT/SUIT_DataObject.cxx index 8aa0b0a0c..c4f31bb0e 100755 --- a/src/SUIT/SUIT_DataObject.cxx +++ b/src/SUIT/SUIT_DataObject.cxx @@ -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. */ diff --git a/src/SUIT/SUIT_DataObject.h b/src/SUIT/SUIT_DataObject.h index f303d0dea..cc4cf374c 100755 --- a/src/SUIT/SUIT_DataObject.h +++ b/src/SUIT/SUIT_DataObject.h @@ -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; -- 2.39.2