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()も参照してください 。
© 2025 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.