From a0f1bc2bd454592d88fbe58a00365717e9e9878e Mon Sep 17 00:00:00 2001 From: sln Date: Wed, 13 Dec 2006 12:33:54 +0000 Subject: [PATCH] ensureItemVisible method has been added --- src/ObjBrowser/OB_Browser.cxx | 14 ++++++++++++++ src/ObjBrowser/OB_Browser.h | 2 ++ 2 files changed, 16 insertions(+) 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* ); -- 2.39.2