Exemplo n.º 1
0
    def mousePressEvent(self, e):
        #print('%s.mousePressEvent, at point: ' % self.__class__.__name__, e.pos(), e.scenePos())
        QGraphicsRectItem.mousePressEvent(
            self, e)  # points would not show up w/o this line

        ps = e.scenePos()
        #print('%s.mousePressEvent itemAt:' % self.__class__.__name__, self.scene().itemAt(ps))

        t = self.scene().views()[0].transform()
        item_sel = self.scene().itemAt(ps.x(), ps.y(), t)
        #item_sel = self.scene().itemAt(ps)

        if item_sel in self.lst_ctl_points:
            #print('set mode EDIT')
            self.set_mode(EDIT)
            self.set_child_item_sel(item_sel)
            self.rect0 = self.rect().normalized()
            self.p0 = self.pos()

            self.p0_ptr = self.ptr.pos()
            self.p0_ptl = self.ptl.pos()
            self.p0_pbr = self.pbr.pos()
            self.p0_pbl = self.pbl.pos()

            if item_sel == self.ped: self.control_point_menu()
Exemplo n.º 2
0
 def mousePressEvent(self, event):
     QGraphicsRectItem.mousePressEvent(self, event)
     self.pressed = True
     self.moving_diff = (0,0)
     self.expand_diff = 0
     self.setCursor(QCursor(Qt.ClosedHandCursor))
     self.setSelected(True)
Exemplo n.º 3
0
 def mousePressEvent(self, mouseEvent):
     if mouseEvent.button() == Qt.LeftButton:
         self.fragmente()
     elif mouseEvent.button() == Qt.RightButton:
         QGraphicsRectItem.hoverLeaveEvent(self, None)
         self.scene().removeItem(self)
     else:
         QGraphicsRectItem.mousePressEvent(self, mouseEvent)
Exemplo n.º 4
0
    def mousePressEvent(self, event):
        if self.is_placed:
            return
        if event.button() == Qt.RightButton:
            return
        self.setScale(self.scale * 1.1)

        self.setZValue(10)
        self.old_position = self.pos()
        self.old_coords = self.coords

        self.setPos(self.x() - 2 * MARGIN, self.y() - 2 * MARGIN)
        self.shadow.show()
        QGraphicsRectItem.mousePressEvent(self, event)
 def mousePressEvent(self, event):
     """
     customized press mouse to change the color
     :param event:
     :return:
     """
     # print(self.ink_flag)
     if self.ink_flag != 0:
         if self.brush() == self._ink_color:
             self.setBrush(self.color)
             # reset the ink flag back to 1
             self.markInkChange()
         else:
             self.setBrush(self._ink_color)
             # change the ink flag to 2, die already inked off
             self.markInkChange()
     QGraphicsRectItem.mousePressEvent(self, event)
Exemplo n.º 6
0
    def mousePressEvent(self, event: QGraphicsSceneMouseEvent):
        """Handler for user mouse press.

        Args:
            event: Contains item, scene, and screen coordinates of the event,
                and previous event.
        """
        self.clearSelectionsIfActiveTool()
        return QGraphicsRectItem.mousePressEvent(self, event)
Exemplo n.º 7
0
    def mousePressEvent(self, event: QGraphicsSceneMouseEvent):
        """Handler for user mouse press.

        Args:
            event: Contains item, scene, and screen coordinates of the event,
                and previous event.
        """
        self.clearSelectionsIfActiveTool()
        return QGraphicsRectItem.mousePressEvent(self, event)
Exemplo n.º 8
0
 def mousePressEvent(self, event):
     if self.rcpg_object.planes[self.i][self.j] == True:
         self.rcpg_object.hide_plane(self.i, self.j)
         self.rcpg_object.refresh_vertices_connections()
         self.rcpg_object.refresh_svg_renderer()
     else:
         self.rcpg_object.unhide_plane(self.i, self.j)
         self.rcpg_object.refresh_vertices_connections()
         self.rcpg_object.refresh_svg_renderer()
     return QGraphicsRectItem.mousePressEvent(self, event)
Exemplo n.º 9
0
    def mousePressEvent(self, event):
        """Handler for user mouse press.

        Args:
            event (QGraphicsSceneMouseEvent): Contains item, scene, and screen
            coordinates of the the event, and previous event.

        Returns:
            TYPE: Description
        """
        print("ADSDsadf")
        self.clearSelectionsIfActiveTool()
        return QGraphicsRectItem.mousePressEvent(self, event)
Exemplo n.º 10
0
    def mousePressEvent(self, event):
        """Handler for user mouse press.

        Args:
            event (QGraphicsSceneMouseEvent): Contains item, scene, and screen
            coordinates of the the event, and previous event.

        Returns:
            TYPE: Description
        """
        print("ADSDsadf")
        self.clearSelectionsIfActiveTool()
        return QGraphicsRectItem.mousePressEvent(self, event)
Exemplo n.º 11
0
    def mousePressEvent(self, e):
        ps = e.scenePos()
        pe = e.pos()

        logger.debug('DragRect.mousePressEvent, at point: %6.1f %6.1f on scene: %6.1f %6.1f'%\
                     (pe.x(), pe.y(), ps.x(), ps.y()))
        QGraphicsRectItem.mousePressEvent(
            self, e)  # points would not show up w/o this line
        #print("DragRect is selected: ", self.isSelected())

        #print('%s.mousePressEvent itemAt:' % self.__class__.__name__, self.scene().itemAt(ps))

        t = self.scene().views()[0].transform()
        i = item_sel = self.scene().itemAt(ps.x(), ps.y(), t)
        #item_sel = self.scene().itemAt(ps)

        if self.lst_ctl_points is None:
            logger.warning('DragRect.lst_ctl_points is None')
            return

        if i in self.lst_ctl_points:

            r = self.rect()

            #print('set mode EDIT')
            self.set_drag_mode(EDIT)
            self.set_child_item_sel(i)
            self.rect0 = self.rect().normalized()
            #self.p0 = self.pos()

            self.p0_ptr = self.ptr.pos()
            self.p0_ptl = self.ptl.pos()
            self.p0_pbr = self.pbr.pos()
            self.p0_pbl = self.pbl.pos()

            if i == self.ped: self.control_point_menu()
Exemplo n.º 12
0
 def mousePressEvent(self, event):
     QGraphicsRectItem.mousePressEvent(self, event)
     self.setSelected(True)
     self.pressed = True
Exemplo n.º 13
0
 def mousePressEvent(self, event):
     QGraphicsRectItem.mousePressEvent(self, event)
     self.stretch = True
Exemplo n.º 14
0
 def mousePressEvent(self, event):
     QGraphicsRectItem.mousePressEvent(self, event)
     self.pressed = True
     self.setBrush(self.click_brush)
     self.piano().noteclicked.emit(self.note, True)
Exemplo n.º 15
0
 def mousePressEvent(self, event):
     self.newEvent.isClicked.emit()
     QGraphicsRectItem.mousePressEvent(self, event)
Exemplo n.º 16
0
 def mousePressEvent(self, event):
     QGraphicsRectItem.mousePressEvent(self, event)
     self.setSelected(True)
     self.pressed = True
Exemplo n.º 17
0
 def mousePressEvent(self, e):
     #logger.debug('mousePressEvent, at point: ', e.pos() #e.globalX(), e.globalY())
     QGraphicsRectItem.mousePressEvent(self, e)
     QApplication.setOverrideCursor(QCursor(self.grub_cursor))
Exemplo n.º 18
0
 def mousePressEvent(self, event):
     QGraphicsRectItem.mousePressEvent(self, event)
     self.stretch = True
Exemplo n.º 19
0
 def mousePressEvent(self, event):
     self.newEvent.isClicked.emit()
     QGraphicsRectItem.mousePressEvent(self, event)