QGraphicsPathItem Class
QGraphicsPathItem 클래스는 QGraphicsScene 에 추가할 수 있는 경로 항목을 제공합니다. 더 보기...
| 헤더: | #include <QGraphicsPathItem> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Widgets) target_link_libraries(mytarget PRIVATE Qt6::Widgets) |
| qmake: | QT += widgets |
| 상속: | QAbstractGraphicsShapeItem |
공개 타입
| enum { Type } |
공개 함수
| QGraphicsPathItem(QGraphicsItem *parent = nullptr) | |
| QGraphicsPathItem(const QPainterPath &path, QGraphicsItem *parent = nullptr) | |
| virtual | ~QGraphicsPathItem() |
| QPainterPath | path() const |
| void | setPath(const QPainterPath &path) |
재구현된 공용 함수
| 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 |
상세 설명
항목의 경로를 설정하려면 QGraphicsPathItem의 생성자에 ` QPainterPath `를 전달하거나 ` setPath()` 함수를 호출하십시오. ` path()` 함수는 현재 경로를 반환합니다.

QGraphicsPathItem은 경로를 사용하여 boundingRect(), shape() 및 contains() 함수를 합리적으로 구현합니다. paint() 함수는 항목에 연결된 펜과 브러시를 사용하여 경로를 그립니다. 이 펜과 브러시는 setPen() 및 setBrush() 함수를 호출하여 설정할 수 있습니다.
QGraphicsRectItem, QGraphicsEllipseItem, QGraphicsPolygonItem, QGraphicsTextItem, QGraphicsLineItem, QGraphicsPixmapItem 및 Graphics View Framework도참조하십시오 .
멤버 함수 문서
[explicit] QGraphicsPathItem::QGraphicsPathItem(QGraphicsItem *parent = nullptr)
QGraphicsPath 객체를 생성합니다. ` parent `는 ` QAbstractGraphicsShapeItem`의 생성자에 전달됩니다.
QGraphicsScene::addItem()도 참조하십시오 .
[explicit] QGraphicsPathItem::QGraphicsPathItem(const QPainterPath &path, QGraphicsItem *parent = nullptr)
path 을 기본 경로로 사용하여 QGraphicsPath 항목을 생성합니다. parent 는 QAbstractGraphicsShapeItem 의 생성자에 전달됩니다.
QGraphicsScene::addItem()도 참조하십시오 .
[virtual noexcept] QGraphicsPathItem::~QGraphicsPathItem()
QGraphicsPathItem 를 삭제합니다.
[override virtual] QRectF QGraphicsPathItem::boundingRect() const
QGraphicsItem::boundingRect() const를 재구현합니다.
[override virtual] bool QGraphicsPathItem::contains(const QPointF &point) const
QGraphicsItem::contains(const QPointF &point) const를 재구현합니다.
[override virtual] bool QGraphicsPathItem::isObscuredBy(const QGraphicsItem *item) const
QAbstractGraphicsShapeItem::isObscuredBy(const QGraphicsItem *item) const를 재구현합니다.
[override virtual] QPainterPath QGraphicsPathItem::opaqueArea() const
QAbstractGraphicsShapeItem::opaqueArea() const를 재구현합니다.
[override virtual] void QGraphicsPathItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr)
QGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)를 재구현합니다.
QPainterPath QGraphicsPathItem::path() const
항목의 경로를 ` QPainterPath` 형식으로 반환합니다. 항목이 설정되어 있지 않으면 빈 ` QPainterPath `가 반환됩니다.
setPath()도 참조하십시오 .
void QGraphicsPathItem::setPath(const QPainterPath &path)
항목의 경로를 지정된 path 로 설정합니다.
path()도 참조하십시오 .
[override virtual] QPainterPath QGraphicsPathItem::shape() const
QGraphicsItem::shape() const를 재구현합니다.
[override virtual] int QGraphicsPathItem::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.