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 anonymous { 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그래픽 보기 프레임워크도참조하세요 .

멤버 유형 문서

enum QGraphicsPathItem::anonymous

가상 type() 함수가 반환하는 값입니다.

상수Value설명
QGraphicsPathItem::Type2그래픽 경로 항목

멤버 함수 문서

[explicit] QGraphicsPathItem::QGraphicsPathItem(QGraphicsItem *parent = nullptr)

QAbstractGraphicsShapeItem 의 생성자에 parent 을 전달합니다.

QGraphicsScene::addItem()도 참조하십시오 .

[explicit] QGraphicsPathItem::QGraphicsPathItem(const QPainterPath &path, QGraphicsItem *parent = nullptr)

path 을 기본 경로로 사용하여 QGraphicsPath 항목을 생성합니다. parentQAbstractGraphicsShapeItem 의 생성자에게 전달됩니다.

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 *페인터, const Q스타일옵션그래픽아이템 *옵션, Q위젯 *위젯).

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.

© 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.