fixed context menu handling for non-GraphicsItems
This commit is contained in:
parent
23a0d6d7c0
commit
19cf49bc7d
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user