예제 #1
0
 def contextMenuEvent(
         self, event: QtWidgets.QGraphicsSceneContextMenuEvent) -> None:
     """Intercept events and pass to overlay."""
     view_pos = event.widget().mapFromGlobal(event.screenPos())
     for item in self.overlayitems:
         if item.contains(view_pos, event.widget().rect()):
             item.item.contextMenuEvent(event)
             return
     super().contextMenuEvent(event)
    def contextMenuEvent(self, event: QGraphicsSceneContextMenuEvent) -> None:
        """
		Opens a context menu (right click menu) for the action wrapper.

		:param event: The event that was generated when the user right-clicked on this item.
		:type event: QGraphicsSceneContextMenuEvent
		:return: None
		:rtype: NoneType
		"""
        self.menu.exec_(event.screenPos())
예제 #3
0
    def contextMenuEvent(self, event: QGraphicsSceneContextMenuEvent):

        if self.model.captured:
            openBaseMenu = QAction("Open base menu")
        else:
            openBaseMenu = QAction("Open intel menu")

        openBaseMenu.triggered.connect(self.openBaseMenu)

        menu = QMenu("Menu", self.parent)
        menu.addAction(openBaseMenu)
        menu.exec_(event.screenPos())
예제 #4
0
    def contextMenuEvent(self, event: QGraphicsSceneContextMenuEvent) -> None:
        menu = QMenu("Menu")

        object_details_action = QAction(self.object_dialog_text)
        object_details_action.triggered.connect(self.on_click)
        menu.addAction(object_details_action)

        new_package_action = QAction(f"New package")
        new_package_action.triggered.connect(self.open_new_package_dialog)
        menu.addAction(new_package_action)

        menu.exec_(event.screenPos())
    def contextMenuEvent(self, event: QGraphicsSceneContextMenuEvent) -> None:
        """
		Opens a context menu (right click menu) for the component.

		:param event: The event that was generated when the user right-clicked on this item.
		:type event: QGraphicsSceneContextMenuEvent
		:return: None
		:rtype: NoneType
		"""
        self.setSelected(True)
        self.menu.prerequest()
        selectedAction = self.menu.exec_(event.screenPos())
예제 #6
0
    def contextMenuEvent(self, event: QGraphicsSceneContextMenuEvent) -> None:
        menu = QMenu("Menu", self.parent)

        object_details_action = QAction(self.object_dialog_text)
        object_details_action.triggered.connect(self.on_click)
        menu.addAction(object_details_action)

        # Not all locations have valid objectives. Off-map spawns, for example,
        # have no mission types.
        if list(self.mission_target.mission_types(for_player=True)):
            new_package_action = QAction(f"New package")
            new_package_action.triggered.connect(self.open_new_package_dialog)
            menu.addAction(new_package_action)

        self.add_context_menu_actions(menu)

        menu.exec_(event.screenPos())
예제 #7
0
    def contextMenuEvent(self, event: QGraphicsSceneContextMenuEvent) -> None:
        menu = QMenu("Menu")

        object_details_action = QAction(self.object_dialog_text)
        object_details_action.triggered.connect(self.on_click)
        menu.addAction(object_details_action)

        new_package_action = QAction(f"New package")
        new_package_action.triggered.connect(self.open_new_package_dialog)
        menu.addAction(new_package_action)

        cheat_forward = QAction(f"CHEAT: Advance Frontline")
        cheat_forward.triggered.connect(self.cheat_forward)
        menu.addAction(cheat_forward)

        cheat_backward = QAction(f"CHEAT: Retreat Frontline")
        cheat_backward.triggered.connect(self.cheat_backward)
        menu.addAction(cheat_backward)

        menu.exec_(event.screenPos())
예제 #8
0
 def contextMenuEvent(self, event: QtWidgets.QGraphicsSceneContextMenuEvent) -> None:
     menu = QtWidgets.QMenu()
     menu.addAction(self.action_copy_to_clipboard)
     menu.exec_(event.screenPos())
예제 #9
0
 def contextMenuEvent(
         self, event: QtWidgets.QGraphicsSceneContextMenuEvent) -> None:
     menu = QtWidgets.QMenu()
     menu.addAction(self.action_edit_label)
     menu.exec_(event.screenPos())
     event.accept()
예제 #10
0
 def contextMenuEvent(self, event: QtWidgets.QGraphicsSceneContextMenuEvent):
     ctxt_menu = QtWidgets.QMenu("")
     ctxt_menu.addAction("Trace backward", lambda: self._data_dep_view.use_subgraph(self, True))
     ctxt_menu.addAction("Trace forward", lambda: self._data_dep_view.use_subgraph(self, False))
     ctxt_menu.exec_(event.screenPos())