이 페이지에서

QCanvasBrush Class

QCanvasBrush는 모든 QCanvasPainter 채우기/선 그리기 브러시의 기본 클래스입니다. 더 보기...

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

공개 유형

enum class BrushType { Invalid, LinearGradient, RadialGradient, ConicalGradient, BoxGradient, …, Custom }

공개 함수

QCanvasBrush()
QCanvasBrush(QCanvasImage &&other)
QCanvasBrush(const QCanvasBrush &brush)
QCanvasBrush(QCanvasBrush &&other)
void swap(QCanvasBrush &other)
QCanvasBrush::BrushType type() const
QCanvasBrush &operator=(QCanvasBrush &&other)
QCanvasBrush &operator=(const QCanvasBrush &brush)
bool operator!=(const QCanvasBrush &lhs, const QCanvasBrush &rhs)
bool operator==(const QCanvasBrush &lhs, const QCanvasBrush &rhs)

상세 설명

QCanvasBrush는 QCanvasPainter::fill() 및 QCanvasPainter::stroke()에 사용되는 모든 스타일의 기본 클래스입니다.

멤버 유형 설명

enum class QCanvasBrush::BrushType

브러시의 유형을 지정합니다.

상수값설명
QCanvasBrush::BrushType::Invalid0- 빈 브러시.
QCanvasBrush::BrushType::LinearGradient1- 시작점과 끝점 사이의 색상을 보간합니다 (QCanvasLinearGradient).
QCanvasBrush::BrushType::RadialGradient2- 초점과 이를 둘러싼 원의 끝점들 사이에서 색상을 보간합니다 (QCanvasRadialGradient).
QCanvasBrush::BrushType::ConicalGradient3- 중심점 주변의 색상을 보간합니다 (QCanvasConicalGradient).
QCanvasBrush::BrushType::BoxGradient4- 둥근 직사각형 위에서 색상을 보간합니다 (QCanvasBoxGradient).
QCanvasBrush::BrushType::BoxShadow5- 부드러운 둥근 직사각형 그림자를 생성합니다 (QCanvasBoxShadow).
QCanvasBrush::BrushType::ImagePattern6- 지정된 이미지와 반복 설정을 사용하여 패턴을 만듭니다 (QCanvasImagePattern).
QCanvasBrush::BrushType::GridPattern7- 지정된 격자를 사용하여 패턴을 만듭니다 (QCanvasGridPattern).
QCanvasBrush::BrushType::Custom1000- 사용자 정의 셰이더 브러시를 생성합니다 (QCanvasCustomBrush).

type()도 참조하십시오 .

멤버 함수 설명서

QCanvasBrush::QCanvasBrush()

유효하지 않은 브러시를 생성합니다.

[noexcept implicit] QCanvasBrush::QCanvasBrush(QCanvasImage &&other)

other 에서 새로운 QCanvasBrush 객체를 생성합니다.

QCanvasBrush::QCanvasBrush(const QCanvasBrush &brush)

지정된 ` brush`의 복사본인 브러시를 생성합니다.

[constexpr noexcept default] QCanvasBrush::QCanvasBrush(QCanvasBrush &&other)

QCanvasBrush 의 인스턴스를 move-construct로 생성합니다.

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

이 브러시를 ‘ other ’로 교체합니다. 이 작업은 매우 빠르며 절대 실패하지 않습니다.

QCanvasBrush::BrushType QCanvasBrush::type() const

브러시의 유형을 반환합니다.

[noexcept] QCanvasBrush &QCanvasBrush::operator=(QCanvasBrush &&other)

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

QCanvasBrush &QCanvasBrush::operator=(const QCanvasBrush &brush)

지정된 brush 를 이 브러시에 할당하고, 이 브러시에 대한 참조를 반환합니다.

관련 비멤버 변수

[noexcept] bool operator!=(const QCanvasBrush &lhs, const QCanvasBrush &rhs)

브러시 lhs 가 rhs 와 다를 경우 true 를 반환하고, 그렇지 않은 경우 false 를 반환합니다.

operator==()도 참조하십시오 .

[noexcept] bool operator==(const QCanvasBrush &lhs, const QCanvasBrush &rhs)

브러시 lhs 가 rhs 와 같으면 true 를 반환하고, 그렇지 않으면 false 를 반환합니다.

브러시는 값을 기준으로 비교되며, 두 개의 QCanvasBrush 를 비교하는 것은 이를 생성한 구체적인 브러시(예: QCanvasGridPattern)를 비교하는 것과 동일한 결과를 반환합니다.

operator!=()도 참조하십시오 .

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