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
항목의 펜을 반환합니다. 펜이 설정되어 있지 않은 경우, 이 함수는 너비가 1인 기본 검은색 실선 펜인 QPen()을 반환합니다.
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.