Helper function to get preferred delete key depending on platform

This commit is contained in:
wmayer
2025-04-28 09:57:15 +02:00
committed by Benjamin Nauck
parent e850cc9824
commit 2a7498c930
13 changed files with 40 additions and 71 deletions

View File

@@ -38,6 +38,7 @@
#include <Gui/Command.h>
#include <Gui/Control.h>
#include <Gui/Selection/SelectionObject.h>
#include <Gui/Tools.h>
#include <Gui/Widgets.h>
#include <Mod/Part/Gui/ViewProvider.h>
@@ -281,11 +282,8 @@ SectionsPanel::SectionsPanel(ViewProviderSections* vp, Surface::Sections* obj)
// 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());
ui->listSections->addAction(action);
connect(action, &QAction::triggered, this, &SectionsPanel::onDeleteEdge);
ui->listSections->setContextMenuPolicy(Qt::ActionsContextMenu);