Python PyQt5.QtWidgets 模块,QGraphicsPathItem() 实例源码

我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用PyQt5.QtWidgets.QGraphicsPathItem()

项目:brown    作者:ajyoon    | 项目源码 | 文件源码
def __init__(self, qt_path, clip_start_x, clip_width):
        """
        Args:
            qt_path (QPainterPath): The path for the item. This value should
                be the same as in `QGraphicsPathItem.__init__()`
            clip_start_x (Unit or None): The local starting position for the
                path clipping region. Use `None` to render from the start.
            clip_width (Unit or None): The width of the path clipping region.
                Use `None` to render to the end
        """
        super().__init__(qt_path)
        self.clip_start_x = clip_start_x
        self.clip_width = clip_width
        self.update_geometry()
项目:brown    作者:ajyoon    | 项目源码 | 文件源码
def paint(self, painter, *args, **kwargs):
        """Paint with automatic clipping.

        This is overridden from `QGraphicsPathItem.paint()`
        """
        painter.save()
        if self.painter_offset:
            painter.translate(self.painter_offset)
        painter.setClipRect(self.clip_rect)
        super().paint(painter, *args, **kwargs)
        painter.restore()
项目:urh    作者:jopohl    | 项目源码 | 文件源码
def clear_path(self):
        for item in self.scene.items():
            if isinstance(item, QGraphicsPathItem) and item != self.peak_item:
                self.scene.removeItem(item)
                item.setParentItem(None)
                del item
项目:urh    作者:jopohl    | 项目源码 | 文件源码
def clear_path(self):
        for item in self.scene.items():
            if isinstance(item, QGraphicsPathItem):
                self.scene.removeItem(item)
                item.setParentItem(None)
                del item