이 페이지에서

QCanvasConicalGradient Class

QCanvasConicalGradient는 원뿔형 그라데이션 그리기를 위한 브러시입니다. 더 보기...

헤더: #include <QCanvasConicalGradient>
CMake: find_package(Qt6 REQUIRED COMPONENTS CanvasPainter)
target_link_libraries(mytarget PRIVATE Qt6::CanvasPainter)
다음부터: Qt 6.11
상속: QCanvasGradient

공개 함수

QCanvasConicalGradient()
QCanvasConicalGradient(QPointF center, qreal startAngle)
QCanvasConicalGradient(qreal centerX, qreal centerY, qreal startAngle)
QCanvasConicalGradient(const QCanvasConicalGradient &)
QCanvasConicalGradient(QCanvasConicalGradient &&)
~QCanvasConicalGradient()
QPointF centerPosition() const
void setCenterPosition(qreal x, qreal y)
void setCenterPosition(QPointF center)
void setStartAngle(qreal angle)
qreal startAngle() const
void swap(QCanvasConicalGradient &other)
QCanvasConicalGradient &operator=(QCanvasConicalGradient &&)
QCanvasConicalGradient &operator=(const QCanvasConicalGradient &)

상세 설명

원뿔형 그라디언트는 지정된 좌표의 점을 중심으로 시작점과 끝점 사이의 색상을 보간합니다. 각도는 중심에서 수평으로 오른쪽으로 뻗은 선에서 시작하여 시계 방향으로 진행됩니다.

중심점을 중심으로 원뿔 모양의 그라데이션이 퍼져 나가는 네 개의 사각형으로, 색상이 각기 다릅니다.

다음은 간단한 예제입니다:

노란색에서 파란색을 거쳐 다시 노란색으로 이어지는 원뿔형 그라디언트가 적용된 원
QRectF rect(20, 20, 160, 160);
QCanvasConicalGradient cg(rect.center(), 1.75 * M_PI);
cg.setColorAt(0.0, "#fdbb2d");
cg.setColorAt(0.5, "#1a2a6c");
cg.setColorAt(1.0, "#fdbb2d");
p->setFillStyle(cg);
p->beginPath();
p->ellipse(rect);
p->fill();

멤버 함수 설명

QCanvasConicalGradient::QCanvasConicalGradient()

기본 원뿔형 그라데이션을 생성합니다. 그라데이션의 중심 위치는 (0, 0)입니다. 그라데이션 각도는 0.0입니다.

QCanvasConicalGradient::QCanvasConicalGradient(QPointF center, qreal startAngle)

원뿔형 그라디언트를 생성합니다. 그라디언트의 중심 위치는 center 입니다. 그라디언트의 시작 각도는 startAngle 입니다.

QCanvasConicalGradient::QCanvasConicalGradient(qreal centerX, qreal centerY, qreal startAngle)

원뿔형 그라디언트를 생성합니다. 그라디언트의 중심 위치는 ( centerX, centerY)입니다. 그라디언트의 시작 각도는 startAngle 입니다.

[constexpr noexcept default] QCanvasConicalGradient::QCanvasConicalGradient(const QCanvasConicalGradient &)

QCanvasConicalGradient 의 인스턴스를 복사하여 생성합니다.

[constexpr noexcept default] QCanvasConicalGradient::QCanvasConicalGradient(QCanvasConicalGradient &&)

QCanvasConicalGradient 의 인스턴스를 생성합니다.

[constexpr noexcept default] QCanvasConicalGradient::~QCanvasConicalGradient()

QCanvasConicalGradient 의 인스턴스를 삭제합니다.

QPointF QCanvasConicalGradient::centerPosition() const

원뿔형 그라디언트의 중심점을 반환합니다.

setCenterPosition()도 참조하십시오 .

void QCanvasConicalGradient::setCenterPosition(qreal x, qreal y)

원뿔형 그라데이션의 중심점을 ( x, y)로 설정합니다.

centerPosition()도 참조하십시오 .

void QCanvasConicalGradient::setCenterPosition(QPointF center)

원뿔형 그라데이션의 중심점을 center 로 설정합니다.

이 함수는 오버로드된 함수입니다.

void QCanvasConicalGradient::setStartAngle(qreal angle)

원뿔형 그라디언트의 시작 각도를 라디안 단위로 angle 로 설정합니다. 이 각도는 중심에서 수평으로 오른쪽을 향한 선을 기점으로 하여 시계 방향으로 진행됩니다.

startAngle()도 참조하십시오 .

qreal QCanvasConicalGradient::startAngle() const

원뿔형 그라디언트의 시작 각도를 라디안 단위로 반환합니다.

setStartAngle()도 참조하십시오 .

[noexcept] void QCanvasConicalGradient::swap(QCanvasConicalGradient &other)

이 그라데이션을 other 로 바꿉니다. 이 작업은 매우 빠르며 실패하는 일이 없습니다.

[noexcept default] QCanvasConicalGradient &QCanvasConicalGradient::operator=(QCanvasConicalGradient &&)

other 를 이 QCanvasConicalGradient 인스턴스에 할당합니다.

[noexcept default] QCanvasConicalGradient &QCanvasConicalGradient::operator=(const QCanvasConicalGradient &)

other 를 이 QCanvasConicalGradient 인스턴스에 복사-할당합니다.

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