Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QGraphicsPolygonItem Class

TheQGraphicsPolygonItem class provides a polygon item that you can add to aQGraphicsScene.More...

Header:#include <QGraphicsPolygonItem>
Since: Qt 4.2
Inherits:QAbstractGraphicsShapeItem
Inherited By:

Public Functions

QGraphicsPolygonItem(QGraphicsItem * parent = 0)
QGraphicsPolygonItem(const QPolygonF & polygon, QGraphicsItem * parent = 0)
~QGraphicsPolygonItem()
Qt::FillRulefillRule() const
QPolygonFpolygon() const
voidsetFillRule(Qt::FillRule rule)
voidsetPolygon(const QPolygonF & polygon)

Reimplemented Public Functions

virtual QRectFboundingRect() const
virtual boolcontains(const QPointF & point) const
virtual boolisObscuredBy(const QGraphicsItem * item) const
virtual QPainterPathopaqueArea() const
virtual voidpaint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0)
virtual QPainterPathshape() const
virtual inttype() const

Additional Inherited Members

Detailed Description

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.

Member Function Documentation

QGraphicsPolygonItem::QGraphicsPolygonItem(QGraphicsItem * parent = 0)

Constructs aQGraphicsPolygonItem.parent is passed toQAbstractGraphicsShapeItem's constructor.

See alsoQGraphicsScene::addItem().

QGraphicsPolygonItem::QGraphicsPolygonItem(constQPolygonF & polygon,QGraphicsItem * parent = 0)

Constructs aQGraphicsPolygonItem withpolygon as the default polygon.parent is passed toQAbstractGraphicsShapeItem's constructor.

See alsoQGraphicsScene::addItem().

QGraphicsPolygonItem::~QGraphicsPolygonItem()

Destroys theQGraphicsPolygonItem.

[virtual]QRectF QGraphicsPolygonItem::boundingRect() const

Reimplemented fromQGraphicsItem::boundingRect().

[virtual]bool QGraphicsPolygonItem::contains(constQPointF & point) const

Reimplemented fromQGraphicsItem::contains().

Qt::FillRule QGraphicsPolygonItem::fillRule() const

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) const

Reimplemented fromQGraphicsItem::isObscuredBy().

[virtual]QPainterPath QGraphicsPolygonItem::opaqueArea() const

Reimplemented fromQGraphicsItem::opaqueArea().

[virtual]void QGraphicsPolygonItem::paint(QPainter * painter, constQStyleOptionGraphicsItem * option,QWidget * widget = 0)

Reimplemented fromQGraphicsItem::paint().

QPolygonF QGraphicsPolygonItem::polygon() const

Returns the item's polygon, or an empty polygon if no polygon has been set.

See alsosetPolygon().

void QGraphicsPolygonItem::setFillRule(Qt::FillRule rule)

Sets the fill rule of the polygon torule. The default fill rule isQt::OddEvenFill.

See alsofillRule(),QPainterPath::fillRule(), andQPainter::drawPolygon().

void QGraphicsPolygonItem::setPolygon(constQPolygonF & polygon)

Sets the item's polygon to be the givenpolygon.

See alsopolygon().

[virtual]QPainterPath QGraphicsPolygonItem::shape() const

Reimplemented fromQGraphicsItem::shape().

[virtual]int QGraphicsPolygonItem::type() const

Reimplemented 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.


[8]ページ先頭

©2009-2025 Movatter.jp