return;
myRootDecorated = decor;
- updateTree();
+ updateTree( 0, false );
}
int OB_Browser::autoOpenLevel() const
myView->setAppropriate( myColumnIds[id], on );
}
-void OB_Browser::updateTree( SUIT_DataObject* obj )
+void OB_Browser::updateTree( SUIT_DataObject* obj, const bool autoOpen )
{
if ( !obj && !(obj = getRootObject()) )
return;
restoreState( selObjs, openObjs, curObj, selKeys, openKeys, curKey );
- autoOpenBranches();
+ if( autoOpen )
+ autoOpenBranches();
if ( selNum != numberOfSelected() )
emit selectionChanged();
if ( openObjs.contains( obj ) )
{
- if ( openObjs[obj] )
+ bool parentOpen = true;
+ if( item && item->parent() )
+ parentOpen = item->parent()->isOpen();
+
+ if ( openObjs[obj] && parentOpen )
lv->setOpen( item, true );
}
else if ( !key.isNull() && openKeys.contains( key ) )
- lv->setOpen( item, true );
+ {
+ bool parentOpen = true;
+ if( item && item->parent() )
+ parentOpen = item->parent()->isOpen();
+
+ if( parentOpen )
+ lv->setOpen( item, true );
+ }
if ( !curItem && ( curObj == obj || ( !curKey.isNull() && curKey == key )) )
curItem = item;
void OB_Browser::keyPressEvent( QKeyEvent* e )
{
if ( e->key() == Qt::Key_F5 )
- updateTree();
+ updateTree( 0, false );
QFrame::keyPressEvent( e );
}
if ( isAutoUpdate() )
{
SUIT_DataObject* pObj = item && item->parent() ? dataObject( item->parent() ) : 0;
- updateTree( pObj );
+ updateTree( pObj, false );
}
else
delete item;
bool isAutoDeleteObjects() const;
virtual void setAutoDeleteObjects( const bool );
- virtual void updateTree( SUIT_DataObject* = 0 );
+ virtual void updateTree( SUIT_DataObject* = 0, const bool autoOpen = true );
virtual void replaceTree( SUIT_DataObject*, SUIT_DataObject* );
bool isShowToolTips();