Beispiel #1
0
    def mousePressEvent(self, mouseEvent):
        QGraphicsScene.mousePressEvent(self, mouseEvent)

        if self.__isControlModifier:
            return

        if mouseEvent.button() == Qt.RightButton:
            self.__kDummy.toggleEditMode()
Beispiel #2
0
    def mousePressEvent(self, mouseEvent):
        QGraphicsScene.mousePressEvent(self, mouseEvent)

        item = self.itemAt(mouseEvent.scenePos())

        if self.__isControlModifier:
            return

        if self.__isNode(item):
            #print item.Properties
            self.__kSelected.Item = item
            self.__propEditor.rebuild(self.__kSelected.Item.Handle.Name, self.__kSelected.Item.Handle.lsProperties())

        elif isinstance(item, EDummy):
            self.__kSelected.Item = None
            self.__propEditor.rebuild("", [])

        if mouseEvent.button() == Qt.RightButton:
            if self.__isNode(self.itemAt(mouseEvent.scenePos())):
                self.__isNodePressed = True
                return

            self.__kDummy.toggleEditMode()
Beispiel #3
0
    def mousePressEvent(self, event):
        if self.user_interaction_handler and \
                self.user_interaction_handler.mousePressEvent(event):
            return

        # Right (context) click on the node item. If the widget is not
        # in the current selection then select the widget (only the widget).
        # Else simply return and let customContextMenuReqested signal
        # handle it
        shape_item = self.item_at(event.scenePos(), items.NodeItem)
        if shape_item and event.button() == Qt.RightButton and \
                shape_item.flags() & QGraphicsItem.ItemIsSelectable:
            if not shape_item.isSelected():
                self.clearSelection()
                shape_item.setSelected(True)

        return QGraphicsScene.mousePressEvent(self, event)
Beispiel #4
0
 def mousePressEvent(self, event):
     if event.buttons() == Qt.LeftButton:
         global current_id
         current_id += 1
         if self.mode == TrackingScene.Add:
             event.accept()
             if self.image_name is not None:
                 pos = event.scenePos()*self.min_scale
                 self.planAddPoints(None, [pos])
         elif self.mode == TrackingScene.ZoomOut:
             event.accept()
             self.zoomOut[QPointF].emit(event.scenePos())
         elif self.mode == TrackingScene.ZoomIn:
             event.accept()
             self.zoomIn[QPointF].emit(event.scenePos())
         elif self.mode == TrackingScene.AddCell:
             for item in self.items(event.scenePos()):
                 if isinstance(item, CellItem):
                     if item.hover:
                         if self.has_current_cell and item.cell_id == self.current_cell:
                             del self.current_cell
                         else:
                             self.current_cell = item.cell_id
                         event.accept()
                         return
             QGraphicsScene.mousePressEvent(self, event)
         elif self.mode == TrackingScene.RemoveCell:
             remove_cell = None
             for item in self.items(event.scenePos()):
                 if isinstance(item, CellItem):
                     remove_cell = item.cell_id
                     break
             if remove_cell is not None:
                 self.planRemoveCells([remove_cell])
         else:
             QGraphicsScene.mousePressEvent(self, event)
     else:
         QGraphicsScene.mousePressEvent(self, event)
Beispiel #5
0
 def mousePressEvent(self, event):
     QGraphicsScene.mousePressEvent(self, event)
Beispiel #6
0
 def mousePressEvent(self, event):
     QGraphicsScene.mousePressEvent(self, event)
Beispiel #7
0
 def mousePressEvent(self, event):
     self.m_mouseLock = True
     self.handleMousePos(event.scenePos())
     QGraphicsScene.mousePressEvent(self, event)
Beispiel #8
0
    def mousePressEvent(self, event):
        if self.mode == 'Edge':
            self.mousePressEventEdge(event)

        QGraphicsScene.mousePressEvent(self, event)