QGraphicsPolygonItem Class
QGraphicsPolygonItem クラスは、QGraphicsScene に追加できるポリゴンアイテムを提供します。詳細...
| ヘッダー: | #include <QGraphicsPolygonItem> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Widgets) target_link_libraries(mytarget PRIVATE Qt6::Widgets) |
| qmake: | QT += widgets |
| 継承元: | QAbstractGraphicsShapeItem |
パブリック型
| enum { Type } |
パブリック関数
| QGraphicsPolygonItem(QGraphicsItem *parent = nullptr) | |
| QGraphicsPolygonItem(const QPolygonF &polygon, QGraphicsItem *parent = nullptr) | |
| virtual | ~QGraphicsPolygonItem() |
| Qt::FillRule | fillRule() const |
| QPolygonF | polygon() const |
| void | setFillRule(Qt::FillRule rule) |
| void | setPolygon(const QPolygonF &polygon) |
再実装されたパブリック関数
| virtual QRectF | boundingRect() const override |
| virtual bool | contains(const QPointF &point) const override |
| virtual bool | isObscuredBy(const QGraphicsItem *item) const override |
| virtual QPainterPath | opaqueArea() const override |
| virtual void | paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override |
| virtual QPainterPath | shape() const override |
| virtual int | type() const override |
詳細な説明
アイテムのポリゴンを設定するには、QPolygonF を QGraphicsPolygonItem のコンストラクタに渡すか、setPolygon() 関数を呼び出します。polygon() 関数は、現在のポリゴンを返します。

QGraphicsPolygonItem は、ポリゴンとペン幅を使用して、boundingRect()、shape()、およびcontains() の適切な実装を提供します。paint() 関数は、アイテムに関連付けられたペンとブラシを使用してポリゴンを描画します。これらの設定は、setPen() およびsetBrush() 関数を呼び出すことで行えます。
関連項目: QGraphicsPathItem 、QGraphicsRectItem 、QGraphicsEllipseItem 、QGraphicsTextItem 、QGraphicsLineItem 、QGraphicsPixmapItem 、およびGraphics View Framework。
メンバ関数のドキュメント
[explicit] QGraphicsPolygonItem::QGraphicsPolygonItem(QGraphicsItem *parent = nullptr)
QGraphicsPolygonItem を生成します。parent は、QAbstractGraphicsShapeItem のコンストラクタに渡されます。
QGraphicsScene::addItem()も参照してください 。
[explicit] QGraphicsPolygonItem::QGraphicsPolygonItem(const QPolygonF &polygon, QGraphicsItem *parent = nullptr)
polygon をデフォルトのポリゴンとして、QGraphicsPolygonItemを生成します。parent は、QAbstractGraphicsShapeItem のコンストラクタに渡されます。
QGraphicsScene::addItem()も参照してください 。
[virtual noexcept] QGraphicsPolygonItem::~QGraphicsPolygonItem()
QGraphicsPolygonItem を破棄します。
[override virtual] QRectF QGraphicsPolygonItem::boundingRect() const
QGraphicsItem::boundingRect() const を再実装します。
[override virtual] bool QGraphicsPolygonItem::contains(const QPointF &point) const
QGraphicsItem::contains (const QPointF &point)const の再実装。
Qt::FillRule QGraphicsPolygonItem::fillRule() const
ポリゴンの塗りつぶしルールを返します。デフォルトの塗りつぶしルールは `Qt::OddEvenFill` です。
setFillRule()、QPainterPath::fillRule()、およびQPainter::drawPolygon()も参照してください 。
[override virtual] bool QGraphicsPolygonItem::isObscuredBy(const QGraphicsItem *item) const
QAbstractGraphicsShapeItem::isObscuredBy(const QGraphicsItem *item) const を再実装します。
[override virtual] QPainterPath QGraphicsPolygonItem::opaqueArea() const
QAbstractGraphicsShapeItem::opaqueArea() const を再実装します。
[override virtual] void QGraphicsPolygonItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr)
QGraphicsItem::paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)を再実装します。
QPolygonF QGraphicsPolygonItem::polygon() const
アイテムのポリゴンを返します。ポリゴンが設定されていない場合は、空のポリゴンを返します。
setPolygon()も参照してください 。
void QGraphicsPolygonItem::setFillRule(Qt::FillRule rule)
ポリゴンの塗りつぶしルールを「rule 」に設定します。デフォルトの塗りつぶしルールは「Qt::OddEvenFill 」です。
fillRule()、QPainterPath::fillRule()、およびQPainter::drawPolygon()も参照してください 。
void QGraphicsPolygonItem::setPolygon(const QPolygonF &polygon)
アイテムのポリゴンを、指定されたpolygon に設定します。
polygon()も参照してください 。
[override virtual] QPainterPath QGraphicsPolygonItem::shape() const
QGraphicsItem::shape() const を再実装します。
[override virtual] int QGraphicsPolygonItem::type() const
QGraphicsItem::type() const を再実装します。
© 2026 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 the GNU 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.