QGraphicsPathItemclass provides a path item that you can add to aQGraphicsScene. 更多 …
To set the item’s path, pass a
QPainterPathtoQGraphicsPathItem‘s constructor, or call thesetPath()function. Thepath()function returns the current path.![]()
QGraphicsPathItemuses the path to provide a reasonable implementation ofboundingRect(),shape(),和contains()。paint()function draws the path using the item’s associated pen and brush, which you can set by calling thesetPen()andsetBrush()函数。
QGraphicsPathItem
(
[
parent=None
]
)
¶
QGraphicsPathItem(path[, parent=None])
- param parent
- param path
QPainterPath
构造 QGraphicsPath。
parent
会被传递给
QAbstractGraphicsShapeItem
‘s constructor.
另请参阅
构造 QGraphicsPath 项使用
path
作为默认路径。
parent
会被传递给
QAbstractGraphicsShapeItem
‘s constructor.
另请参阅
PySide2.QtWidgets.QGraphicsPathItem.
path
(
)
¶
QPainterPath
Returns the item’s path as a
QPainterPath
。若未设置项,空
QPainterPath
被返回。
另请参阅