def contextMenuEvent(self, event): operator = GraphOperator(graph=self.graph(), graphScene=self.scene()) widget = operator.get_sensible_parent() operator.set_annotation_item(self) menu = qtutils.AleaQMenu(widget) styleMenu = menu.addMenu("Style...") styleMenu.addAction( operator("Simple", styleMenu, "annotation_change_style_simple")) styleMenu.addAction( operator("Box", styleMenu, "annotation_change_style_box")) #display the menu... menu.move(event.screenPos()) menu.show() event.accept()
def contextMenuEvent(self, event): operator = GraphOperator(graph=self.graph(), graphScene = self.scene()) widget = operator.get_sensible_parent() operator.set_annotation_item(self) menu = qtutils.AleaQMenu(widget) styleMenu = menu.addMenu("Style...") styleMenu.addAction(operator("Simple", styleMenu, "annotation_change_style_simple")) styleMenu.addAction(operator("Box", styleMenu, "annotation_change_style_box")) #display the menu... menu.move(event.screenPos()) menu.show() event.accept()