From: asl Date: Mon, 28 Apr 2008 12:49:12 +0000 (+0000) Subject: fix for PAL19420: correct implementation of popup items switching on/off the toolbars X-Git-Tag: V5_0_0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5cdb0d3993bd5bd9090adf0fa8c063930768990b;p=modules%2Fgui.git fix for PAL19420: correct implementation of popup items switching on/off the toolbars --- diff --git a/src/SVTK/SVTK_ViewModel.cxx b/src/SVTK/SVTK_ViewModel.cxx index 8e5360537..b8edb171c 100644 --- a/src/SVTK/SVTK_ViewModel.cxx +++ b/src/SVTK/SVTK_ViewModel.cxx @@ -196,9 +196,11 @@ SVTK_Viewer thePopup->addSeparator(); if(TViewWindow* aView = dynamic_cast(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 lst = qFindChildren( aView ); + QList::const_iterator it = lst.begin(), last = lst.end(); + for( ; it!=last; it++ ) + thePopup->addAction( (*it)->toggleViewAction() ); aView->RefreshDumpImage(); } } @@ -275,29 +277,6 @@ SVTK_Viewer } } -/*! - SLOT: called when popup item "Show toolbar" is activated, shows toolbar of active view window -*/ -void -SVTK_Viewer -::onShowToolbar() -{ - QVector aViews = myViewManager->getViews(); - for(int i = 0, iEnd = aViews.size(); i < iEnd; i++){ - if(TViewWindow* aView = dynamic_cast(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(aObj); - if (aToolBar) aToolBar->show(); - } - } - } - } -} - - /*! Display presentation \param prs - presentation diff --git a/src/SVTK/SVTK_ViewModel.h b/src/SVTK/SVTK_ViewModel.h index db6c4d79d..a76da1dbc 100644 --- a/src/SVTK/SVTK_ViewModel.h +++ b/src/SVTK/SVTK_ViewModel.h @@ -113,7 +113,6 @@ protected slots: void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*); void onDumpView(); - void onShowToolbar(); void onChangeBgColor(); private: