QAbstractGraphicsShapeItem Class
QAbstractGraphicsShapeItem クラスは、すべてのパスアイテムに対する共通の基底クラスを提供します。詳細...
| ヘッダー: | #include <QAbstractGraphicsShapeItem> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Widgets) target_link_libraries(mytarget PRIVATE Qt6::Widgets) |
| qmake: | QT += widgets |
| 継承元: | QGraphicsItem |
| 継承元: | QGraphicsEllipseItem、QGraphicsPathItem 、QGraphicsPolygonItem 、QGraphicsRectItem 、およびQGraphicsSimpleTextItem |
パブリック関数
| QAbstractGraphicsShapeItem(QGraphicsItem *parent = nullptr) | |
| virtual | ~QAbstractGraphicsShapeItem() |
| QBrush | brush() const |
| QPen | pen() const |
| void | setBrush(const QBrush &brush) |
| void | setPen(const QPen &pen) |
再実装されたパブリック関数
| virtual bool | isObscuredBy(const QGraphicsItem *item) const override |
| virtual QPainterPath | opaqueArea() const override |
詳細な説明
このクラス自体は、アイテムを完全に実装しているわけではありません。特に、QGraphicsItem によって継承されるboundingRect() およびpaint() は実装されていません。
このアイテムをサブクラス化することで、アイテムのペンおよびブラシに対するアクセサの単純な基本実装を提供することができます。
関連項目: QGraphicsRectItem 、QGraphicsEllipseItem 、QGraphicsPathItem 、QGraphicsPolygonItem 、QGraphicsTextItem 、QGraphicsLineItem 、QGraphicsPixmapItem 、およびGraphics View Framework。
メンバ関数のドキュメント
[explicit] QAbstractGraphicsShapeItem::QAbstractGraphicsShapeItem(QGraphicsItem *parent = nullptr)
QAbstractGraphicsShapeItem を作成します。parent は、QGraphicsItem のコンストラクタに渡されます。
[virtual noexcept] QAbstractGraphicsShapeItem::~QAbstractGraphicsShapeItem()
QAbstractGraphicsShapeItem を破棄します。
QBrush QAbstractGraphicsShapeItem::brush() const
アイテムのブラシを返します。ブラシが設定されていない場合は、空のブラシを返します。
setBrush()も参照してください 。
[override virtual] bool QAbstractGraphicsShapeItem::isObscuredBy(const QGraphicsItem *item) const
QGraphicsItem::isObscuredBy(const QGraphicsItem *item) const の再実装です。
[override virtual] QPainterPath QAbstractGraphicsShapeItem::opaqueArea() const
QGraphicsItem::opaqueArea() const を再実装します。
QPen QAbstractGraphicsShapeItem::pen() const
アイテムのペンを返します。ペンが設定されていない場合、この関数は QPen() を返します。これは、幅 1 のデフォルトの黒の実線ペンです。
setPen()も参照してください 。
void QAbstractGraphicsShapeItem::setBrush(const QBrush &brush)
アイテムのブラシをbrush に設定します。
アイテムのブラシは、アイテムを塗りつぶすために使用されます。
QGradient を持つブラシを使用する場合、グラデーションは項目の座標系を基準とします。
brush()も参照してください 。
void QAbstractGraphicsShapeItem::setPen(const QPen &pen)
このアイテムのペンを「pen 」に設定します。
ペンは、項目の輪郭を描画するために使用されます。
pen()も参照してください 。
© 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.