(#539) Prevent context menu events to be propagated to parent

When a context menu is created in the viewer is, and the action
triggered is displaying a dialog,
the context menu of QMainWindow is displayed after the action has
finished
Setting this policy will make sure the handling is not deferred to the
widget's parent,
which solves the problem - Qt::PreventContextMenu
This commit is contained in:
Magne Sjaastad 2015-10-21 13:15:38 +02:00
parent 8de8100c3e
commit 4b95f2b807

View File

@ -152,6 +152,12 @@ RiuViewer::RiuViewer(const QGLFormat& format, QWidget* parent)
m_animationProgress->setFont(regTestFont);
m_histogramWidget->setFont(regTestFont);
}
// When a context menu is created in the viewer is, and the action triggered is displaying a dialog,
// the context menu of QMainWindow is displayed after the action has finished
// Setting this policy will make sure the handling is not deferred to the widget's parent,
// which solves the problem
setContextMenuPolicy(Qt::PreventContextMenu);
}