X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_HistoryMenu.cpp;h=5f1ee6fa863020654cda263e5b691ff563ba7de6;hb=8265a72ffc4629fde76928773cffbca1db07e2dd;hp=bfdae5390686816d58f6cd6fb00056083e99dccb;hpb=45fa5730565366d6450a2cac86965eafc5b4e0be;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_HistoryMenu.cpp b/src/XGUI/XGUI_HistoryMenu.cpp index bfdae5390..5f1ee6fa8 100644 --- a/src/XGUI/XGUI_HistoryMenu.cpp +++ b/src/XGUI/XGUI_HistoryMenu.cpp @@ -82,9 +82,23 @@ void XGUI_HistoryMenu::setStackSelectedTo(QListWidgetItem * theItem) myHistoryList->repaint(); } +void hideUpToMenuBar( QMenu* theMenu ) +{ + theMenu->hide(); + foreach( QWidget* aWidget, theMenu->menuAction()->associatedWidgets() ) + { + QMenu* aMenu = qobject_cast( aWidget ); + if( aMenu ) + { + aMenu->hide(); + hideUpToMenuBar( aMenu ); + } + } +} + void XGUI_HistoryMenu::onItemPressed(QListWidgetItem * theItem) { int selectedSize = myHistoryList->row(theItem) + 1; emit actionSelected(selectedSize); - hide(); + hideUpToMenuBar( this ); }