Beispiel #1
0
    def mouseReleaseEvent(self, mouseEvent):

        if mouseEvent.button() == Qt.RightButton:
            self.__kDummy.toggleEditMode()

        self.update()

        QGraphicsScene.mouseReleaseEvent(self, mouseEvent)
Beispiel #2
0
    def mouseReleaseEvent(self, mouseEvent):

        if mouseEvent.button() == Qt.RightButton:
            if self.__isNodePressed:
                self.__isNodePressed = False
                return

            self.__kDummy.toggleEditMode()

        self.update()

        QGraphicsScene.mouseReleaseEvent(self, mouseEvent)
 def mouseReleaseEvent(self, event):
     items = self.getSelected()
     if items:
         starts = []
         ends = []
         moved_ids = []
         data = self.current_data
         #pt_scale = (self.scale[0]/self.img_scale[0], self.scale[1]/self.scale[1])
         for item in items:
             pos = item.pos()*self.min_scale
             old_pos = data[item.pt_id]
             if pos != old_pos:
                 moved_ids.append(item.pt_id)
                 starts.append(old_pos)
                 ends.append(pos)
         if moved_ids:
             self.planMovePoints(moved_ids, ends, starts)
     elif self.mode == TrackingScene.AddCell:
         QGraphicsScene.mouseReleaseEvent(self, event)
         if event.isAccepted():
             return
         items = self.items(event.scenePos())
         if items:
             pt = items[0]
             if isinstance(pt, PointItem):
                 pt_id = pt.pt_id
                 cells = self.current_data.cells
                 if self.has_current_cell:
                     cid = self.current_cell
                     cell_shape = list(cells[cid])
                     if pt_id in cell_shape:
                         cell_shape.remove(pt_id)
                         self.planChangeCell(cid, cell_shape)
                     else:
                         cell_shape.append(pt_id)
                         self.planChangeCell(cid, cell_shape)
                 else:
                     cid = self.current_cell
                     cell_shape = [pt_id]
                     self.planAddCell(cid, cell_shape)
         return
     QGraphicsScene.mouseReleaseEvent(self, event)
Beispiel #4
0
 def mouseReleaseEvent(self, event):
     if self.user_interaction_handler and \
             self.user_interaction_handler.mouseReleaseEvent(event):
         return
     return QGraphicsScene.mouseReleaseEvent(self, event)
Beispiel #5
0
 def mouseReleaseEvent(self, event):
     if event.button() == Qt.LeftButton:
         if self.selectionRect:
             self.removeItem(self.selectionRect)
             self.selectionRect = None
     QGraphicsScene.mouseReleaseEvent(self, event)
Beispiel #6
0
 def mouseReleaseEvent(self, event):
     self.m_mouseLock = False
     QGraphicsScene.mouseReleaseEvent(self, event)
Beispiel #7
0
    def mouseReleaseEvent(self, event):
        if self.mode == 'Edge':
            self.mouseReleaseEventEdge(event)

        QGraphicsScene.mouseReleaseEvent(self, event)
Beispiel #8
0
 def mouseReleaseEvent(self, event):
     if event.button() == Qt.LeftButton:
         if self.selectionRect:
             self.removeItem(self.selectionRect)
             self.selectionRect = None
     QGraphicsScene.mouseReleaseEvent(self, event)