Skip to content

Commit

Permalink
Gui: [skip ci] workaround for Qt5.12.9 that causes a crash in the par…
Browse files Browse the repository at this point in the history
…ameter editor for right clicks in an empty area
  • Loading branch information
wwmayer committed Oct 17, 2020
1 parent ce87f58 commit 28270e5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Gui/DlgParameterImp.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit 28270e5

Please sign in to comment.