
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQGraphicsPathItem class provides a path item that you can add to aQGraphicsScene.More...
| Header: | #include <QGraphicsPathItem> |
| Since: | Qt 4.2 |
| Inherits: | QAbstractGraphicsShapeItem |
| QGraphicsPathItem(QGraphicsItem * parent = 0) | |
| QGraphicsPathItem(const QPainterPath & path, QGraphicsItem * parent = 0) | |
| ~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 = 0) |
| virtual QPainterPath | shape() const |
| virtual int | type() const |
TheQGraphicsPathItem class provides a path item that you can add to aQGraphicsScene.
To set the item's path, pass aQPainterPath toQGraphicsPathItem's constructor, or call thesetPath() function. Thepath() function returns the current path.

QGraphicsPathItem uses the path to provide a reasonable implementation ofboundingRect(),shape(), andcontains(). Thepaint() function draws the path using the item's associated pen and brush, which you can set by calling thesetPen() andsetBrush() functions.
See alsoQGraphicsRectItem,QGraphicsEllipseItem,QGraphicsPolygonItem,QGraphicsTextItem,QGraphicsLineItem,QGraphicsPixmapItem, andGraphics View Framework.
Constructs a QGraphicsPath.parent is passed toQAbstractGraphicsShapeItem's constructor.
See alsoQGraphicsScene::addItem().
Constructs a QGraphicsPath item usingpath as the default path.parent is passed toQAbstractGraphicsShapeItem's constructor.
See alsoQGraphicsScene::addItem().
Destroys theQGraphicsPathItem.
[virtual]QRectF QGraphicsPathItem::boundingRect() constReimplemented fromQGraphicsItem::boundingRect().
[virtual]bool QGraphicsPathItem::contains(constQPointF & point) constReimplemented fromQGraphicsItem::contains().
[virtual]bool QGraphicsPathItem::isObscuredBy(constQGraphicsItem * item) constReimplemented fromQGraphicsItem::isObscuredBy().
[virtual]QPainterPath QGraphicsPathItem::opaqueArea() constReimplemented fromQGraphicsItem::opaqueArea().
[virtual]void QGraphicsPathItem::paint(QPainter * painter, constQStyleOptionGraphicsItem * option,QWidget * widget = 0)Reimplemented fromQGraphicsItem::paint().
Returns the item's path as aQPainterPath. If no item has been set, an emptyQPainterPath is returned.
See alsosetPath().
Sets the item's path to be the givenpath.
See alsopath().
[virtual]QPainterPath QGraphicsPathItem::shape() constReimplemented fromQGraphicsItem::shape().
[virtual]int QGraphicsPathItem::type() constReimplemented fromQGraphicsItem::type().
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.