이 페이지에서

QGraphicsEllipseItem Class

QGraphicsEllipseItem 클래스는 QGraphicsScene 에 추가할 수 있는 타원 항목을 제공합니다. 더 보기...

헤더: #include <QGraphicsEllipseItem>
CMake: find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
상속: QAbstractGraphicsShapeItem

공개 유형

enum { Type }

공개 함수

QGraphicsEllipseItem(QGraphicsItem *parent = nullptr)
QGraphicsEllipseItem(const QRectF &rect, QGraphicsItem *parent = nullptr)
QGraphicsEllipseItem(qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent = nullptr)
virtual ~QGraphicsEllipseItem()
QRectF rect() const
void setRect(const QRectF &rect)
void setRect(qreal x, qreal y, qreal width, qreal height)
void setSpanAngle(int angle)
void setStartAngle(int angle)
int spanAngle() const
int startAngle() const

재구현된 공용 함수

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

상세 설명

QGraphicsEllipseItem은 채우기와 윤곽선이 있는 타원을 나타내며, 타원 세그먼트에도 사용할 수 있습니다( startAngle(), spanAngle() 참조).

완전한 타원형시작 각도와 지속 각도를 가진 타원형

아이템의 타원을 설정하려면 QRectF 를 QGraphicsEllipseItem의 생성자에 전달하거나 setRect()를 호출하십시오. rect() 함수는 현재 타원의 기하학적 구조를 반환합니다.

QGraphicsEllipseItem은 rect와 펜 너비를 사용하여 boundingRect(), shape() 및 contains()을 적절하게 구현합니다. paint() 함수는 항목에 연결된 펜과 브러시를 사용하여 타원을 그립니다. 이 펜과 브러시는 setPen() 및 setBrush()를 호출하여 설정할 수 있습니다.

QGraphicsPathItem, QGraphicsRectItem, QGraphicsPolygonItem, QGraphicsTextItem, QGraphicsLineItem, QGraphicsPixmapItem 및 그래픽스 뷰 프레임워크도참조하십시오 .

멤버 유형 문서

[anonymous] enum

가상 함수 ` type()`가 반환하는 값.

상수값설명
QGraphicsEllipseItem::Type4그래픽 타원 항목

멤버 함수 설명서

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

QGraphicsEllipseItem을 생성합니다. ` parent `는 ` QAbstractGraphicsShapeItem`의 생성자에 전달됩니다.

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

[explicit] QGraphicsEllipseItem::QGraphicsEllipseItem(const QRectF &rect, QGraphicsItem *parent = nullptr)

rect 를 기본 사각형으로 사용하여 QGraphicsEllipseItem을 생성합니다. parent 는 QAbstractGraphicsShapeItem 의 생성자에 전달됩니다.

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

[explicit] QGraphicsEllipseItem::QGraphicsEllipseItem(qreal x, qreal y, qreal width, qreal height, QGraphicsItem *parent = nullptr)

(x, y)으로 정의된 사각형과, 주어진 width 및 height 을 기본 사각형으로 사용하여 QGraphicsEllipseItem을 생성합니다. parent 는 QAbstractGraphicsShapeItem 의 생성자에 전달됩니다.

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

[virtual noexcept] QGraphicsEllipseItem::~QGraphicsEllipseItem()

QGraphicsEllipseItem 를 삭제합니다.

[override virtual] QRectF QGraphicsEllipseItem::boundingRect() const

QGraphicsItem::boundingRect() const를 재구현합니다.

[override virtual] bool QGraphicsEllipseItem::contains(const QPointF &point) const

QGraphicsItem::contains(const QPointF &point) const를 재구현합니다.

[override virtual] bool QGraphicsEllipseItem::isObscuredBy(const QGraphicsItem *item) const

QAbstractGraphicsShapeItem::isObscuredBy(const QGraphicsItem *item) const를 재구현합니다.

[override virtual] QPainterPath QGraphicsEllipseItem::opaqueArea() const

QAbstractGraphicsShapeItem::opaqueArea() const를 재구현합니다.

[override virtual] void QGraphicsEllipseItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr)

QGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)를 재구현합니다.

QRectF QGraphicsEllipseItem::rect() const

항목의 타원형 지오메트리를 ` QRectF` 객체로 반환합니다.

setRect() 및 QPainter::drawEllipse()도 참조하십시오 .

void QGraphicsEllipseItem::setRect(const QRectF &rect)

항목의 타원 형상을 rect 로 설정합니다. 사각형의 왼쪽 가장자리는 타원의 왼쪽 가장자리를 정의하고, 사각형의 위쪽 가장자리는 타원의 위쪽을 나타냅니다. 사각형의 높이와 너비는 타원의 높이와 너비를 나타냅니다.

rect() 및 QPainter::drawEllipse()도 참조하십시오 .

void QGraphicsEllipseItem::setRect(qreal x, qreal y, qreal width, qreal height)

항목의 사각형을 (x, y)로 정의된 사각형과, 지정된 width 및 height 값으로 설정합니다.

이 편의 함수는 다음을 호출하는 것과 동일합니다. setRect(QRectF(x, y, width, height))

rect()도 참조하십시오 .

void QGraphicsEllipseItem::setSpanAngle(int angle)

타원 세그먼트의 스팬 각도를 angle 로 설정합니다. 이 값은 도의 16분의 1 단위로 표시됩니다. 이 각도는 startAngle() 함수와 함께 사용되어 타원 세그먼트(파이)를 표현합니다. 기본적으로 스팬 각도는 5760(360 * 16, 전체 타원)입니다.

spanAngle(), setStartAngle() 및 QPainter::drawPie()도 참조하십시오 .

void QGraphicsEllipseItem::setStartAngle(int angle)

타원 세그먼트의 시작 각도를 angle 로 설정합니다. 이 값은 도의 16분의 1 단위입니다. 이 각도는 spanAngle()와 함께 타원 세그먼트(파이)를 표현하는 데 사용됩니다. 기본적으로 시작 각도는 0입니다.

startAngle(), setSpanAngle(), QPainter::drawPie()도 참조하십시오 .

[override virtual] QPainterPath QGraphicsEllipseItem::shape() const

QGraphicsItem::shape() const를 재구현합니다.

int QGraphicsEllipseItem::spanAngle() const

타원 세그먼트의 스팬 각도를 16분의 1도 단위로 반환합니다. 이 각도는 startAngle() 함수와 함께 타원 세그먼트(파이)를 표현하는 데 사용됩니다. 기본적으로 이 함수는 5760(360 × 16, 전체 타원)을 반환합니다.

setSpanAngle() 및 startAngle()도 참조하십시오 .

int QGraphicsEllipseItem::startAngle() const

타원 세그먼트의 시작 각도를 16분의 1도 단위로 반환합니다. 이 각도는 타원 세그먼트(파이)를 표현하기 위해 spanAngle() 함수와 함께 사용됩니다. 기본적으로 시작 각도는 0입니다.

setStartAngle() 및 spanAngle()도 참조하십시오 .

[override virtual] int QGraphicsEllipseItem::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.