From: asl Date: Thu, 23 Mar 2006 11:07:49 +0000 (+0000) Subject: PAL10940 : value of hypothesis isn't shown in object browser X-Git-Tag: for_sharm~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0df25d10b6a4a02ec2a690dfb9c53a0f65b28477;p=modules%2Fgui.git PAL10940 : value of hypothesis isn't shown in object browser --- diff --git a/src/ObjBrowser/OB_Browser.cxx b/src/ObjBrowser/OB_Browser.cxx index afd74b39a..6eb296fe5 100755 --- a/src/ObjBrowser/OB_Browser.cxx +++ b/src/ObjBrowser/OB_Browser.cxx @@ -124,7 +124,8 @@ bool OB_BrowserSync::needUpdate( const ItemPtr& item ) const SUIT_DataObject* obj = item->dataObject(); if ( obj ) { // 1. check text - update = ( item->text( 0 ) != obj->name() ); + update = ( item->text( 0 ) != obj->name() ) || myBrowser->needToUpdateTexts( item ); + if ( !update ) { // 2. check pixmap (compare serialNumber()-s) QPixmap objPix = obj->icon(); @@ -151,6 +152,7 @@ void OB_BrowserSync::updateItem( const ItemPtr& p ) const { if ( p && needUpdate( p ) ) { // printf( "--- needUpdate for %s = true ---\n", p->text( 0 ).latin1() ); + myBrowser->updateText( p ); p->update(); } } @@ -1116,6 +1118,18 @@ void OB_Browser::updateText() } } +bool OB_Browser::needToUpdateTexts( QListViewItem* item ) const +{ + SUIT_DataObject* obj = dataObject( item ); + if ( !obj ) + return false; + + for( QMap::const_iterator it = myColumnIds.begin(); it != myColumnIds.end(); ++it ) + if( item->text( it.data() ) != obj->text( it.key() ) ) + return true; + return false; +} + void OB_Browser::updateText( QListViewItem* item ) { SUIT_DataObject* obj = dataObject( item ); diff --git a/src/ObjBrowser/OB_Browser.h b/src/ObjBrowser/OB_Browser.h index a6e3cd421..9ee6e6bce 100755 --- a/src/ObjBrowser/OB_Browser.h +++ b/src/ObjBrowser/OB_Browser.h @@ -162,6 +162,7 @@ private: void removeObject( SUIT_DataObject*, const bool = true ); void updateText( QListViewItem* ); + bool needToUpdateTexts( QListViewItem* ) const; DataObjectKey objectKey( QListViewItem* ) const; DataObjectKey objectKey( SUIT_DataObject* ) const;