
We bake cookies in your browser for a better experience. Using this site means that you consent.Read More
TheQGraphicsPolygonItem class provides a polygon item that you can add to aQGraphicsScene.More...
| Header: | #include <QGraphicsPolygonItem> |
| Since: | Qt 4.2 |
| Inherits: | QAbstractGraphicsShapeItem |
| Inherited By: |
| QGraphicsPolygonItem(QGraphicsItem * parent = 0) | |
| QGraphicsPolygonItem(const QPolygonF & polygon, QGraphicsItem * parent = 0) | |
| ~QGraphicsPolygonItem() | |
| Qt::FillRule | fillRule() const |
| QPolygonF | polygon() const |
| void | setFillRule(Qt::FillRule rule) |
| void | setPolygon(const QPolygonF & polygon) |
| 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 |
TheQGraphicsPolygonItem class provides a polygon item that you can add to aQGraphicsScene.
To set the item's polygon, pass aQPolygonF toQGraphicsPolygonItem's constructor, or call thesetPolygon() function. Thepolygon() function returns the current polygon.

QGraphicsPolygonItem uses the polygon and the pen width to provide a reasonable implementation ofboundingRect(),shape(), andcontains(). Thepaint() function draws the polygon using the item's associated pen and brush, which you can set by calling thesetPen() andsetBrush() functions.
See alsoQGraphicsPathItem,QGraphicsRectItem,QGraphicsEllipseItem,QGraphicsTextItem,QGraphicsLineItem,QGraphicsPixmapItem, andGraphics View Framework.
Constructs aQGraphicsPolygonItem.parent is passed toQAbstractGraphicsShapeItem's constructor.
See alsoQGraphicsScene::addItem().
Constructs aQGraphicsPolygonItem withpolygon as the default polygon.parent is passed toQAbstractGraphicsShapeItem's constructor.
See alsoQGraphicsScene::addItem().
Destroys theQGraphicsPolygonItem.
[virtual]QRectF QGraphicsPolygonItem::boundingRect() constReimplemented fromQGraphicsItem::boundingRect().
[virtual]bool QGraphicsPolygonItem::contains(constQPointF & point) constReimplemented fromQGraphicsItem::contains().
Returns the fill rule of the polygon. The default fill rule isQt::OddEvenFill.
See alsosetFillRule(),QPainterPath::fillRule(), andQPainter::drawPolygon().
[virtual]bool QGraphicsPolygonItem::isObscuredBy(constQGraphicsItem * item) constReimplemented fromQGraphicsItem::isObscuredBy().
[virtual]QPainterPath QGraphicsPolygonItem::opaqueArea() constReimplemented fromQGraphicsItem::opaqueArea().
[virtual]void QGraphicsPolygonItem::paint(QPainter * painter, constQStyleOptionGraphicsItem * option,QWidget * widget = 0)Reimplemented fromQGraphicsItem::paint().
Returns the item's polygon, or an empty polygon if no polygon has been set.
See alsosetPolygon().
Sets the fill rule of the polygon torule. The default fill rule isQt::OddEvenFill.
See alsofillRule(),QPainterPath::fillRule(), andQPainter::drawPolygon().
Sets the item's polygon to be the givenpolygon.
See alsopolygon().
[virtual]QPainterPath QGraphicsPolygonItem::shape() constReimplemented fromQGraphicsItem::shape().
[virtual]int QGraphicsPolygonItem::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.