QCanvasBoxGradient Class
QCanvasBoxGradient는 상자 그라데이션 그리기용 브러시입니다. 더 보기...
| 헤더: | #include <QCanvasBoxGradient> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS CanvasPainter) target_link_libraries(mytarget PRIVATE Qt6::CanvasPainter) |
| 다음부터: | Qt 6.11 |
| 상속: | QCanvasGradient |
공개 함수
| QCanvasBoxGradient() | |
| QCanvasBoxGradient(const QRectF &rect) | |
| QCanvasBoxGradient(qreal x, qreal y, qreal width, qreal height) | |
| QCanvasBoxGradient(const QCanvasBoxGradient &) | |
| QCanvasBoxGradient(QCanvasBoxGradient &&) | |
| ~QCanvasBoxGradient() | |
| qreal | feather() const |
| qreal | radius() const |
| QRectF | rect() const |
| void | setFeather(qreal feather) |
| void | setRadius(qreal radius) |
| void | setRect(qreal x, qreal y, qreal width, qreal height) |
| void | setRect(const QRectF &rect) |
| void | swap(QCanvasBoxGradient &other) |
| QCanvasBoxGradient & | operator=(QCanvasBoxGradient &&) |
| QCanvasBoxGradient & | operator=(const QCanvasBoxGradient &) |
상세 설명
박스 그라디언트는 시작점과 끝점 사이의 색상을 보간하여 둥근 직사각형 모양의 그라디언트를 생성합니다. ` setRadius()` 및 ` setFeather()`을 사용하여 그라디언트의 둥글기와 부드러움을 조절할 수 있습니다.

다음은 간단한 예시입니다:
![]() | |
참고: QCanvasBoxGradient를 사용하여 둥근 사각형을 그릴때는 , 둥글림이 경로(path)가 아닌 브러시(brush)에서 비롯되므로 일반적으로 QCanvasPainter::roundRect()보다 QCanvasPainter::rect()를 사용하는 것이 더 좋습니다. 이렇게 하면 불필요한 꼭짓점이 생성되는 것을 방지하여 성능이 향상됩니다.
멤버 함수 문서
QCanvasBoxGradient::QCanvasBoxGradient()
기본 상자 그라데이션을 생성합니다. 그라데이션의 위치는 (0, 0)이며 크기는 (100, 100)입니다. 그라데이션 페더는 10.0이고, 그라데이션 반경은 0.0입니다.
QCanvasBoxGradient::QCanvasBoxGradient(const QRectF &rect)
상자 그라데이션을 생성합니다. 그라데이션의 위치와 크기는 rect 입니다. 그라데이션 페더는 10.0이고 반경은 0.0입니다.
setFeather() 및 setRadius()도 참조하십시오 .
QCanvasBoxGradient::QCanvasBoxGradient(qreal x, qreal y, qreal width, qreal height)
상자 그라데이션을 생성합니다. 그라데이션의 위치는 ( x, y)이며, 크기는 ( width, height)입니다. 그라데이션 페더는 10.0이고 반경은 0.0입니다.
setFeather() 및 setRadius()도 참조하십시오 .
[constexpr noexcept default] QCanvasBoxGradient::QCanvasBoxGradient(const QCanvasBoxGradient &)
QCanvasBoxGradient 의 인스턴스를 복사 생성합니다.
[constexpr noexcept default] QCanvasBoxGradient::QCanvasBoxGradient(QCanvasBoxGradient &&)
QCanvasBoxGradient 의 인스턴스를 move-construct로 생성합니다.
[constexpr noexcept default] QCanvasBoxGradient::~QCanvasBoxGradient()
QCanvasBoxGradient 의 인스턴스를 삭제합니다.
qreal QCanvasBoxGradient::feather() const
박스 그라데이션의 페더 값을 반환합니다.
setFeather()도 참조하십시오 .
qreal QCanvasBoxGradient::radius() const
박스 그라데이션의 반지름을 반환합니다.
setRadius()도 참조하십시오 .
QRectF QCanvasBoxGradient::rect() const
박스 그라데이션의 직사각형 면적을 반환합니다.
setRect()도 참조하십시오 .
void QCanvasBoxGradient::setFeather(qreal feather)
박스 그라데이션의 페더를 ‘ feather ’로 설정합니다.
feather()도 참조하십시오 .
void QCanvasBoxGradient::setRadius(qreal radius)
박스 그라디언트의 반지름을 ` radius`로 설정합니다. 최대 반지름은 ` rect()`의 너비 또는 높이 중 더 작은 값의 절반입니다.
radius()도 참조하십시오 .
void QCanvasBoxGradient::setRect(qreal x, qreal y, qreal width, qreal height)
박스 그라디언트의 직사각형을 위치( x, y)와 크기( width, height)로 설정합니다.
rect()도 참조하십시오 .
void QCanvasBoxGradient::setRect(const QRectF &rect)
박스 그라데이션의 직사각형을 rect 로 설정합니다.
이 함수는 오버로드된 함수입니다.
[noexcept] void QCanvasBoxGradient::swap(QCanvasBoxGradient &other)
이 그라데이션을 other 로 바꿉니다. 이 작업은 매우 빠르며 실패하는 경우가 전혀 없습니다.
[noexcept default] QCanvasBoxGradient &QCanvasBoxGradient::operator=(QCanvasBoxGradient &&)
other 를 이 QCanvasBoxGradient 인스턴스에 할당합니다.
[noexcept default] QCanvasBoxGradient &QCanvasBoxGradient::operator=(const QCanvasBoxGradient &)
other 를 이 QCanvasBoxGradient 인스턴스에 복사-할당합니다.
© 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.
