thePopup->addSeparator();
if(TViewWindow* aView = dynamic_cast<TViewWindow*>(myViewManager->getActiveView())){
- if ( !aView->getMainWindow()->getToolBar()->isVisible() ){
- thePopup->addAction( VTKViewer_Viewer::tr( "MEN_SHOW_TOOLBAR" ), this, SLOT( onShowToolbar() ) );
- }
+ //Support of several toolbars in the popup menu
+ QList<QToolBar*> lst = qFindChildren<QToolBar*>( aView );
+ QList<QToolBar*>::const_iterator it = lst.begin(), last = lst.end();
+ for( ; it!=last; it++ )
+ thePopup->addAction( (*it)->toggleViewAction() );
aView->RefreshDumpImage();
}
}
}
}
-/*!
- SLOT: called when popup item "Show toolbar" is activated, shows toolbar of active view window
-*/
-void
-SVTK_Viewer
-::onShowToolbar()
-{
- QVector<SUIT_ViewWindow*> aViews = myViewManager->getViews();
- for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){
- if(TViewWindow* aView = dynamic_cast<TViewWindow*>(aViews.at(i))){
- //aView->getMainWindow()->getToolBar()->show();
- const QObjectList& aChildren = aView->getMainWindow()->children();
- foreach (QObject* aObj, aChildren) {
- if (aObj->inherits("QToolBar")) {
- QToolBar* aToolBar = dynamic_cast<QToolBar*>(aObj);
- if (aToolBar) aToolBar->show();
- }
- }
- }
- }
-}
-
-
/*!
Display presentation
\param prs - presentation