Helper function to get preferred delete key depending on platform
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include <Gui/BitmapFactory.h>
|
||||
#include <Gui/Command.h>
|
||||
#include <Gui/Selection/Selection.h>
|
||||
#include <Gui/Tools.h>
|
||||
#include <Gui/ViewProvider.h>
|
||||
#include <Mod/PartDesign/App/Body.h>
|
||||
#include <Mod/PartDesign/App/FeatureBoolean.h>
|
||||
@@ -84,15 +85,11 @@ TaskBooleanParameters::TaskBooleanParameters(ViewProviderBoolean* BooleanView, Q
|
||||
|
||||
// Create context menu
|
||||
QAction* action = new QAction(tr("Remove"), this);
|
||||
{
|
||||
auto& rcCmdMgr = Gui::Application::Instance->commandManager();
|
||||
auto shortcut = rcCmdMgr.getCommandByName("Std_Delete")->getShortcut();
|
||||
action->setShortcut(QKeySequence(shortcut));
|
||||
}
|
||||
action->setShortcut(Gui::QtTools::deleteKeySequence());
|
||||
|
||||
// display shortcut behind the context menu entry
|
||||
action->setShortcutVisibleInContextMenu(true);
|
||||
|
||||
|
||||
ui->listWidgetBodies->addAction(action);
|
||||
connect(action, &QAction::triggered, this, &TaskBooleanParameters::onBodyDeleted);
|
||||
ui->listWidgetBodies->setContextMenuPolicy(Qt::ActionsContextMenu);
|
||||
|
||||
Reference in New Issue
Block a user