protected:
protected slots:
- void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
- void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
- void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
- void onKeyPress(SUIT_ViewWindow*, QKeyEvent*);
+ virtual void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
+ virtual void onMouseMove(SUIT_ViewWindow*, QMouseEvent*);
+ virtual void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
+ virtual void onKeyPress(SUIT_ViewWindow*, QKeyEvent*);
void onDumpView();
void onChangeBgColor();
void onChangeBgImageTiled();
void onChangeBgImageStretched();
-private:
+protected:
Handle(V3d_Viewer) myV3dViewer;
Handle(V3d_Viewer) myV3dCollector;
}
}
+/*!
+ \brief Make the view item for specified data object is visible.
+ \param obj data object
+*/
+void SUIT_DataBrowser::ensureVisible( SUIT_DataObject* obj )
+{
+ if ( !obj )
+ return;
+
+ DataObjectList lst;
+ lst.append( obj );
+ ensureVisible( lst );
+}
+
+/*!
+ \brief Make the view items for specified data objects is visible.
+ \param lst data object list
+*/
+void SUIT_DataBrowser::ensureVisible( const DataObjectList& lst )
+{
+ QtxTreeView* tv = treeView();
+ SUIT_AbstractModel* treeModel = dynamic_cast<SUIT_AbstractModel*>( model() );
+ if ( !tv || !treeModel )
+ return;
+
+ for ( DataObjectList::const_iterator it = lst.begin(); it != lst.end(); ++it )
+ {
+ QModelIndex idx = treeModel->index( *it );
+ if ( idx.isValid() )
+ tv->scrollTo( idx );
+ }
+}
+
/*!
\brief Add custom actions to the popup menu.
\param menu popup menu
void setAutoSizeColumns( const bool on );
void setResizeOnExpandItem( const bool on );
+ void ensureVisible( SUIT_DataObject* );
+ void ensureVisible( const DataObjectList& );
+
protected:
virtual void contextMenuEvent( QContextMenuEvent* );