From: sln Date: Wed, 13 Dec 2006 12:33:54 +0000 (+0000) Subject: ensureItemVisible method has been added X-Git-Tag: CTH_V12~32 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a0f1bc2bd454592d88fbe58a00365717e9e9878e;p=modules%2Fgui.git ensureItemVisible method has been added --- diff --git a/src/ObjBrowser/OB_Browser.cxx b/src/ObjBrowser/OB_Browser.cxx index 2456e168c..4b0b4840d 100755 --- a/src/ObjBrowser/OB_Browser.cxx +++ b/src/ObjBrowser/OB_Browser.cxx @@ -1627,3 +1627,17 @@ void OB_Browser::setModified() myModifiedTime = clock(); } +/*! + Ensures that object obj is visible, scrolling the list view vertically + if necessary and opening (expanding) any parent items if this is required to show the item. +*/ +void OB_Browser::ensureItemVisible( const SUIT_DataObject* obj ) +{ + QListViewItem* item = listViewItem( obj ); + if ( item ) + listView()->ensureItemVisible( item ); +} + + + + diff --git a/src/ObjBrowser/OB_Browser.h b/src/ObjBrowser/OB_Browser.h index 5dfb52b29..a190c586e 100755 --- a/src/ObjBrowser/OB_Browser.h +++ b/src/ObjBrowser/OB_Browser.h @@ -128,6 +128,8 @@ public: void setModified(); unsigned long getModifiedTime() { return myModifiedTime; } + void ensureItemVisible( const SUIT_DataObject* ); + signals: void selectionChanged(); void doubleClicked( SUIT_DataObject* );