From cb4d9b23b2144e6b23b8022c973f249c7c855586 Mon Sep 17 00:00:00 2001 From: wuyuanyi135 Date: Sun, 3 Nov 2019 00:36:58 -0400 Subject: [PATCH] fix flowchart context menu redundant menu (#1060) --- pyqtgraph/flowchart/Flowchart.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyqtgraph/flowchart/Flowchart.py b/pyqtgraph/flowchart/Flowchart.py index 5aeeac38..2e7ed0eb 100644 --- a/pyqtgraph/flowchart/Flowchart.py +++ b/pyqtgraph/flowchart/Flowchart.py @@ -834,9 +834,9 @@ class FlowchartWidget(dockarea.DockArea): def buildMenu(self, pos=None): def buildSubMenu(node, rootMenu, subMenus, pos=None): for section, node in node.items(): - menu = QtGui.QMenu(section) - rootMenu.addMenu(menu) - if isinstance(node, OrderedDict): + if isinstance(node, OrderedDict): + menu = QtGui.QMenu(section) + rootMenu.addMenu(menu) buildSubMenu(node, menu, subMenus, pos=pos) subMenus.append(menu) else: