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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user