![]() tRight(boundingRect.right() - offset)Įlif self.handleSelected = self.handleMiddleLeft:Įlif self.handleSelected = self.handleMiddleRight:Įlif self.handleSelected = self.handleBottomLeft: tLeft(boundingRect.left() + offset)Įlif self.handleSelected = self.handleTopMiddle:Įlif self.handleSelected = self.handleTopRight: If self.handleSelected = self.handleTopLeft: Offset = self.handleSize + self.handleSpace Here are the kernel code of resize: def interactiveResize(self, mousePos): This causes QGraphicsItem.pos() and QGraphicsItem.scenePos() return wrong pos(200,200) instead of the position of the upper left corner (scenePos: (100,100)), and this pos information is very important to me. At this time, the origin of the local coordinate system of QGraphicsItem has not changed, it is still (0,0)(scenePos:(200,200)), not the upper left corner (-100,-100)(scenePos:(100,100)). Now drag(resize) its upper left corner to the scene coordinate (100,100), that is, the QGraphicsItem becomes (100,100,200,200). For example, the initial QGraphicsItem is (200,200,100,100), where the scene coordinate (200,200) is the origin point of the local coordinates. ![]() The code refered the issue Resize a QGraphicsItem with the mouse, but when I resized the item, the local coordinate system of the QGraphicsItem is destructed. ![]() I encountered a problem when resizing the QGraphicsItem. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |