homography.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:SantosGUI 作者: santosfamilyfoundation 项目源码 文件源码
def mousePressEvent(self, event):
        super(HomographyScene, self).mousePressEvent(event)
        loc = (event.scenePos().x(), event.scenePos().y())
        clicked_point, cp_index = self.find_clicked_point(loc)
        if clicked_point:
            if event.button() == Qt.RightButton:  # Right click to delete points
                self.delete_point(clicked_point, cp_index)
            else:  # Note that we are currently moving a point
                self.point_selected = True
                self.selected_point = clicked_point
                self.selected_point.setCursor(self.parent().cursor_drag)
        else:  # Otherwise add a new point
            if self.main_pixmap_item.isUnderMouse():  # Check to make sure we're in the image.
                self.add_point(loc)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号