From a7f2944c07c79261089eaada6623b06be20ffe89 Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 5 Jun 2017 12:58:12 +0300 Subject: [PATCH] Fix management of "local" actions - they should not be added to the top level main window in case if shortcut context is set to specific widget. --- src/CAM/CAM_Module.cxx | 4 +++- src/SUIT/SUIT_Application.cxx | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/CAM/CAM_Module.cxx b/src/CAM/CAM_Module.cxx index 6a8e49f36..b886d8f55 100755 --- a/src/CAM/CAM_Module.cxx +++ b/src/CAM/CAM_Module.cxx @@ -1027,7 +1027,9 @@ int CAM_Module::registerAction( const int id, QAction* a ) if ( toolMgr() ) toolMgr()->registerAction( a ); - if ( application() && application()->desktop() ) + if ( application() && application()->desktop() && + a->shortcutContext() != Qt::WidgetShortcut && + a->shortcutContext() != Qt::WidgetWithChildrenShortcut ) application()->desktop()->addAction( a ); return ident; diff --git a/src/SUIT/SUIT_Application.cxx b/src/SUIT/SUIT_Application.cxx index 75d32cfc6..06d9180ed 100644 --- a/src/SUIT/SUIT_Application.cxx +++ b/src/SUIT/SUIT_Application.cxx @@ -693,7 +693,8 @@ int SUIT_Application::registerAction( const int id, QAction* a ) if ( desktop() && desktop()->toolMgr() ) desktop()->toolMgr()->registerAction( a ); - if ( desktop() ) + if ( desktop() && a->shortcutContext() != Qt::WidgetShortcut && + a->shortcutContext() != Qt::WidgetWithChildrenShortcut ) desktop()->addAction( a ); return ident; -- 2.30.2