Helper function to get preferred delete key depending on platform

This commit is contained in:
wmayer
2025-06-09 18:10:52 +02:00
committed by Benjamin Nauck
parent 64497cea4b
commit 017f2c8842
13 changed files with 40 additions and 71 deletions
@@ -37,6 +37,7 @@
#include <Gui/ViewProvider.h>
#include <Gui/Selection/Selection.h>
#include <Gui/Command.h>
#include <Gui/Tools.h>
#include <Mod/PartDesign/App/Body.h>
#include <Mod/PartDesign/App/FeatureAddSub.h>
#include <Mod/PartDesign/App/FeatureTransformed.h>
@@ -102,11 +103,8 @@ void TaskTransformedParameters::setupUI()
// Create context menu
auto 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->listWidgetFeatures->addAction(action);