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 | anonymous { 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() 참조).
![]() | ![]() |
항목의 타원을 설정하려면 QGraphicsEllipseItem의 생성자에 QRectF 을 전달하거나 setRect()을 호출합니다. rect () 함수는 현재 타원 지오메트리를 반환합니다.
QGraphicsEllipseItem은 직사각형과 펜 너비를 사용하여 boundingRect(), shape() 및 contains()의 합리적인 구현을 제공합니다. paint () 함수는 항목의 연결된 펜과 브러시를 사용하여 타원을 그리며, setPen() 및 setBrush()를 호출하여 설정할 수 있습니다.
QGraphicsPathItem, QGraphicsRectItem, QGraphicsPolygonItem, QGraphicsTextItem, QGraphicsLineItem, QGraphicsPixmapItem 및 그래픽 보기 프레임워크도참조하세요 .
회원 유형 문서
enum QGraphicsEllipseItem::anonymous
가상 type() 함수가 반환하는 값입니다.
상수 | Value | 설명 |
---|---|---|
QGraphicsEllipseItem::Type | 4 | 그래픽 타원 항목 |
멤버 함수 문서
void QGraphicsEllipseItem::setRect(qreal x, qreal y, qreal width, qreal height)
항목의 직사각형을 (x, y)와 지정된 width 및 height 에 정의된 직사각형으로 설정합니다.
이 편의 함수는 setRect(QRectF(x, y, width, height))
rect()도 참조하세요 .
[explicit]
QGraphicsEllipseItem::QGraphicsEllipseItem(QGraphicsItem *parent = nullptr)
QAbstractGraphicsShapeItem 의 생성자에 parent 을 전달합니다.
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 *페인터, const Q스타일옵션그래픽아이템 *옵션, Q위젯 *위젯).
QRectF QGraphicsEllipseItem::rect() const
항목의 타원 지오메트리를 QRectF 로 반환합니다.
setRect() 및 QPainter::drawEllipse()도 참조하세요 .
void QGraphicsEllipseItem::setRect(const QRectF &rect)
항목의 타원 지오메트리를 rect 로 설정합니다. 직사각형의 왼쪽 가장자리는 타원의 왼쪽 가장자리를 정의하고 직사각형의 위쪽 가장자리는 타원의 위쪽을 설명합니다. 직사각형의 높이와 너비는 타원의 높이와 너비를 나타냅니다.
rect() 및 QPainter::drawEllipse()도 참조하세요 .
void QGraphicsEllipseItem::setSpanAngle(int angle)
타원 세그먼트의 스팬 각도를 16분의 1도 단위인 angle 로 설정합니다. 이 각도는 startAngle()와 함께 타원 세그먼트(파이)를 나타내는 데 사용됩니다. 기본적으로 스팬 각도는 5760(360 * 16, 전체 타원)입니다.
spanAngle(), setStartAngle() 및 QPainter::drawPie()도 참조하세요 .
void QGraphicsEllipseItem::setStartAngle(int angle)
타원 세그먼트의 시작 각도를 16분의 1도 단위인 angle 로 설정합니다. 이 각도는 타원 세그먼트(파이)를 나타낼 때 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.
© 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.