The QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene . 更多...
头: | #include <QGraphicsPathItem> |
qmake: | QT += widgets |
Since: | Qt 4.2 |
继承: | QAbstractGraphicsShapeItem |
QGraphicsPathItem (QGraphicsItem * parent = Q_NULLPTR) | |
QGraphicsPathItem (const QPainterPath & path , QGraphicsItem * parent = Q_NULLPTR) | |
~QGraphicsPathItem () | |
QPainterPath | path () const |
void | setPath (const QPainterPath & path ) |
virtual QRectF | boundingRect () const |
virtual bool | contains (const QPointF & point ) const |
virtual bool | isObscuredBy (const QGraphicsItem * item ) const |
virtual QPainterPath | opaqueArea () const |
virtual void | paint (QPainter * painter , const QStyleOptionGraphicsItem * option , QWidget * widget = Q_NULLPTR) |
virtual QPainterPath | shape () const |
virtual int | type () const |
The QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene .
要设置项的路径,传递 QPainterPath to QGraphicsPathItem 's constructor, or call the setPath () 函数。 path () 函数返回当前路径。
QGraphicsPathItem uses the path to provide a reasonable implementation of boundingRect (), shape (),和 contains ()。 paint () 函数使用项关联的钢笔和笔刷绘制路径,可以设置通过调用 setPen () 和 setBrush () 函数。
另请参阅 QGraphicsRectItem , QGraphicsEllipseItem , QGraphicsPolygonItem , QGraphicsTextItem , QGraphicsLineItem , QGraphicsPixmapItem ,和 图形视图框架 .
构造 QGraphicsPath。 parent 会被传递给 QAbstractGraphicsShapeItem 的构造函数。
另请参阅 QGraphicsScene::addItem ().
构造 QGraphicsPath 项使用 path 作为默认路径。 parent 会被传递给 QAbstractGraphicsShapeItem 的构造函数。
另请参阅 QGraphicsScene::addItem ().
销毁 QGraphicsPathItem .
[虚拟]
QRectF
QGraphicsPathItem::
boundingRect
() const
重实现自 QGraphicsItem::boundingRect ().
[虚拟]
bool
QGraphicsPathItem::
contains
(const
QPointF
&
point
) const
重实现自 QGraphicsItem::contains ().
[虚拟]
bool
QGraphicsPathItem::
isObscuredBy
(const
QGraphicsItem
*
item
) const
重实现自 QGraphicsItem::isObscuredBy ().
[虚拟]
QPainterPath
QGraphicsPathItem::
opaqueArea
() const
重实现自 QGraphicsItem::opaqueArea ().
[虚拟]
void
QGraphicsPathItem::
paint
(
QPainter
*
painter
, const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
= Q_NULLPTR)
重实现自 QGraphicsItem::paint ().
将项的路径返回作为 QPainterPath 。若未设置项,空 QPainterPath 被返回。
另请参阅 setPath ().
将项的路径设为给定 path .
另请参阅 path ().
[虚拟]
QPainterPath
QGraphicsPathItem::
shape
() const
重实现自 QGraphicsItem::shape ().
[虚拟]
int
QGraphicsPathItem::
type
() const
重实现自 QGraphicsItem::type ().