Fix Surface task panel shortcut use to use Widget context

The Delete key shortcut of the three different panels in the
Surface Workbench TaskFilling sidebar conflicted between
the panels if multiple were showing. This is resolved by
making the QAction's context the widget, rather than the window.
This commit is contained in:
Chris Hennes
2021-02-01 19:40:33 -06:00
parent 15afa3ae59
commit a6b689f57c
3 changed files with 3 additions and 0 deletions

View File

@@ -272,6 +272,7 @@ FillingPanel::FillingPanel(ViewProviderFilling* vp, Surface::Filling* obj)
// Create context menu
QAction* action = new QAction(tr("Remove"), this);
action->setShortcut(QString::fromLatin1("Del"));
action->setShortcutContext(Qt::WidgetShortcut);
ui->listBoundary->addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(onDeleteEdge()));
ui->listBoundary->setContextMenuPolicy(Qt::ActionsContextMenu);

View File

@@ -128,6 +128,7 @@ FillingEdgePanel::FillingEdgePanel(ViewProviderFilling* vp, Surface::Filling* ob
// Create context menu
QAction* action = new QAction(tr("Remove"), this);
action->setShortcut(QString::fromLatin1("Del"));
action->setShortcutContext(Qt::WidgetShortcut);
ui->listUnbound->addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(onDeleteUnboundEdge()));
ui->listUnbound->setContextMenuPolicy(Qt::ActionsContextMenu);

View File

@@ -127,6 +127,7 @@ FillingVertexPanel::FillingVertexPanel(ViewProviderFilling* vp, Surface::Filling
// Create context menu
QAction* action = new QAction(tr("Remove"), this);
action->setShortcut(QString::fromLatin1("Del"));
action->setShortcutContext(Qt::WidgetShortcut);
ui->listFreeVertex->addAction(action);
connect(action, SIGNAL(triggered()), this, SLOT(onDeleteVertex()));
ui->listFreeVertex->setContextMenuPolicy(Qt::ActionsContextMenu);