RectangularGlow QML Type
흐릿하고 색이 입혀진 사각형을 생성하여, 원본이 빛나는 듯한 인상을 줍니다. 더 보기...
| Import Statement: | import Qt5Compat.GraphicalEffects |
| Since: | QtGraphicalEffects 1.0 |
| Inherits: |
속성
- cached : bool
- color : color
- cornerRadius : real
- glowRadius : real
- spread : real
상세 설명
이 효과는 우수한 성능을 발휘하도록 설계되었습니다. 광효과의 모양은 사용자 지정 모서리 반경을 가진 직사각형으로 제한됩니다. 사용자 지정 모양이 필요한 경우에는 ' Glow ' 효과를 고려해 보십시오.
| 효과 적용 |
|---|
|
예시
다음 예제는 이 효과를 적용하는 방법을 보여줍니다.
import QtQuick
import Qt5Compat.GraphicalEffects
Item {
width: 300
height: 300
Rectangle {
id: background
anchors.fill: parent
color: "black"
}
RectangularGlow {
id: effect
anchors.fill: rect
glowRadius: 10
spread: 0.2
color: "white"
cornerRadius: rect.radius + glowRadius
}
Rectangle {
id: rect
color: "black"
anchors.centerIn: parent
width: Math.round(parent.width / 1.5)
height: Math.round(parent.height / 2)
radius: 25
}
}속성 설명
cached : bool
이 속성을 사용하면 렌더링 성능을 향상시키기 위해 이펙트 출력 픽셀을 캐시에 저장할 수 있습니다.
소스나 효과 속성이 변경될 때마다 캐시에 저장된 픽셀을 업데이트해야 합니다. 효과 출력을 저장하기 위해 추가 메모리 버퍼가 필요하기 때문에 메모리 사용량이 증가합니다.
소스 또는 효과 속성이 애니메이션 처리될 때는 캐시를 비활성화하는 것이 좋습니다.
기본적으로 이 속성은 ' false'로 설정되어 있습니다.
color : color
이 속성은 빛남 효과에 사용되는 RGBA 색상 값을 정의합니다.
기본적으로 이 속성은 "white" 로 설정되어 있습니다.
| 서로 다른 색상 값을 사용한 출력 예시 | ||
|---|---|---|
|
|
|
| color: #ffffff | color: #55ff55 | color: #5555ff |
| glowRadius: 20 | glowRadius: 20 | glowRadius: 20 |
| spread: 0 | spread: 0 | spread: 0 |
| cornerRadius: 25 | cornerRadius: 25 | cornerRadius: 25 |
cornerRadius : real
이 속성은 모서리가 둥근 광효 펄을 그릴 때 사용되는 모서리 반경을 정의합니다.
값의 범위는 0.0부터 글로우의 유효 너비 또는 높이의 절반 중 더 작은 값까지입니다. 이는 다음 식으로 계산할 수 있습니다: min(width, height) / 2.0 + glowRadius
기본적으로 이 속성은 ` glowRadius ` 속성에 바인딩됩니다. ` glowRadius ` 속성을 조정할 때, 글로우는 마치 직사각형이 흐려진 것처럼 동작합니다.
| 다양한 cornerRadius 값을 적용한 출력 예시 | ||
|---|---|---|
|
|
|
| cornerRadius: 0 | cornerRadius: 25 | cornerRadius: 50 |
| glowRadius: 20 | glowRadius: 20 | glowRadius: 20 |
| spread: 0 | spread: 0 | spread: 0 |
| color: #ffffff | color: #ffffff | color: #ffffff |
glowRadius : real
이 속성은 아이템 영역 밖까지 광효주가 뻗어나가는 픽셀 수를 정의합니다.
값의 범위는 0.0(글로우 없음)부터 inf(무한한 글로우)까지입니다. 기본적으로 이 속성은 ` 0.0`로 설정되어 있습니다.
| 다양한 glowRadius 값을 적용한 출력 예시 | ||
|---|---|---|
|
|
|
| glowRadius: 10 | glowRadius: 20 | glowRadius: 40 |
| spread: 0 | spread: 0 | spread: 0 |
| color: #ffffff | color: #ffffff | color: #ffffff |
| cornerRadius: 25 | cornerRadius: 25 | cornerRadius: 25 |
spread : real
이 속성은 광원 가장자리 부근에서 글로우 색상의 밝기가 얼마나 강화되는지를 정의합니다.
값의 범위는 0.0(강도 증가 없음)부터 1.0(최대 강도 증가)까지입니다. 기본적으로 이 속성은 0.0 로 설정되어 있습니다.
| 다양한 확산 값을 적용한 출력 예시 | ||
|---|---|---|
|
|
|
| spread: 0.0 | spread: 0.5 | 확산: 1.0 |
| glowRadius: 20 | glowRadius: 20 | glowRadius: 20 |
| color: #ffffff | color: #ffffff | color: #ffffff |
| cornerRadius: 25 | cornerRadius: 25 | cornerRadius: 25 |
© 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.












