diff --git a/src/Gui/DlgParameterImp.cpp b/src/Gui/DlgParameterImp.cpp index 6054c4f397..4fdbf8dcd3 100644 --- a/src/Gui/DlgParameterImp.cpp +++ b/src/Gui/DlgParameterImp.cpp @@ -701,10 +701,17 @@ bool ParameterValue::edit ( const QModelIndex & index, EditTrigger trigger, QEve void ParameterValue::contextMenuEvent ( QContextMenuEvent* event ) { QTreeWidgetItem* item = currentItem(); - if (item && item->isSelected()) + if (item && item->isSelected()) { menuEdit->popup(event->globalPos()); - else - menuNew->popup(event->globalPos()); + } + else { + // There is a regression in Qt 5.12.9 where it isn't checked that a sub-menu (here menuNew) + // can be popped up without its parent menu (menuEdit) and thus causes a crash. + // A workaround is to simply call exec() instead. + // + //menuNew->popup(event->globalPos()); + menuNew->exec(event->globalPos()); + } } void ParameterValue::keyPressEvent (QKeyEvent* event)