fixed context menu handling for non-GraphicsItems

This commit is contained in:
Luke Campagnola 2013-11-21 23:29:03 -05:00
parent 23a0d6d7c0
commit 19cf49bc7d

View File

@ -525,6 +525,8 @@ class GraphicsScene(QtGui.QGraphicsScene):
item = item.parentItem() item = item.parentItem()
if item is None: if item is None:
item = self item = self
if not hasattr(item, "getContextMenus"):
continue
subMenus = item.getContextMenus(event) or [] subMenus = item.getContextMenus(event) or []
if isinstance(subMenus, list): ## so that some items (like FlowchartViewBox) can return multiple menus if isinstance(subMenus, list): ## so that some items (like FlowchartViewBox) can return multiple menus
menusToAdd.extend(subMenus) menusToAdd.extend(subMenus)