内容表

上一话题

QGraphicsOpacityEffect

下一话题

QGraphicsPixmapItem

QGraphicsPathItem

QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene . 更多

Inheritance diagram of PySide2.QtWidgets.QGraphicsPathItem

概要

函数

详细描述

To set the item’s path, pass a QPainterPath to QGraphicsPathItem ‘s constructor, or call the setPath() function. The path() function returns the current path.

../../_images/graphicsview-pathitem.png

QGraphicsPathItem uses the path to provide a reasonable implementation of boundingRect() , shape() ,和 contains() paint() function draws the path using the item’s associated pen and brush, which you can set by calling the setPen() and setBrush() 函数。

class QGraphicsPathItem ( [ parent=None ] )

QGraphicsPathItem(path[, parent=None])

param parent

QGraphicsItem

param path

QPainterPath

构造 QGraphicsPath。 parent 会被传递给 QAbstractGraphicsShapeItem ‘s constructor.

另请参阅

addItem()

构造 QGraphicsPath 项使用 path 作为默认路径。 parent 会被传递给 QAbstractGraphicsShapeItem ‘s constructor.

另请参阅

addItem()

PySide2.QtWidgets.QGraphicsPathItem. path ( )
返回类型

QPainterPath

Returns the item’s path as a QPainterPath 。若未设置项,空 QPainterPath 被返回。

另请参阅

setPath()

PySide2.QtWidgets.QGraphicsPathItem. setPath ( path )
参数

path QPainterPath

Sets the item’s path to be the given path .

另请参阅

path()