From 4b95f2b807f429a7f3e5af3b9a647bbb04647679 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 21 Oct 2015 13:15:38 +0200 Subject: [PATCH] (#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 --- ApplicationCode/UserInterface/RiuViewer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ApplicationCode/UserInterface/RiuViewer.cpp b/ApplicationCode/UserInterface/RiuViewer.cpp index 6ea2cabd47..0f4e6d88fd 100644 --- a/ApplicationCode/UserInterface/RiuViewer.cpp +++ b/ApplicationCode/UserInterface/RiuViewer.cpp @@ -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); }