Gui: [skip ci] workaround for Qt5.12.9 that causes a crash in the parameter editor for right clicks in an empty area

This commit is contained in:
wmayer
2020-10-17 20:06:53 +02:00
parent 633fa6e3ac
commit 0f007c1370

View File

@@ -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)