示例#1
0
文件: scene.py 项目: huazhicai/edit
 def contextMenuEvent(self, event):
     transform = QTransform(1, 0, 0, 0, 1, 0, 0, 0, 1)
     if self.itemAt(event.scenePos(), QTransform()):
         QGraphicsScene.contextMenuEvent(self, event)
     else:
         if not self.showDynamicMenu:
             return
         self.menu.exec_(event.screenPos())
示例#2
0
    def contextMenuEvent(self, event):
        if self.m_ctrl_down:
            event.accept()
            self.triggerRubberbandScale()
            return

        if len(self.selectedItems()) == 0:
            event.accept()
            canvas.callback(ACTION_BG_RIGHT_CLICK, 0, 0, "")
            return

        QGraphicsScene.contextMenuEvent(self, event)
示例#3
0
    def contextMenuEvent(self, event):
        if QApplication.keyboardModifiers() & Qt.ControlModifier:
            event.accept()
            self.triggerRubberbandScale()
            return

        if len(self.selectedItems()) == 0:
            event.accept()
            x, y = event.screenPos().x(), event.screenPos().y()
            canvas.callback(ACTION_BG_RIGHT_CLICK, x, y, "")
            return

        QGraphicsScene.contextMenuEvent(self, event)
示例#4
0
    def contextMenuEvent(self, event):
        if self.handleMouseRelease():
            self.m_mouse_down_init = False
            QGraphicsScene.contextMenuEvent(self, event)
            return

        if event.modifiers() & Qt.ControlModifier:
            event.accept()
            self.triggerRubberbandScale()
            return

        if len(self.selectedItems()) == 0:
            self.m_mouse_down_init = False
            event.accept()
            canvas.callback(ACTION_BG_RIGHT_CLICK, 0, 0, "")
            return

        self.m_mouse_down_init = False
        QGraphicsScene.contextMenuEvent(self, event)