DtkDeclarative  5.6.10
DTK Declarative module
RectangularShadow类 参考

一种只支持硬件渲染模式的矩形阴影控件. 更多...

类 RectangularShadow 继承关系图:

属性

real offsetX
 offsetX 属性定义阴影在x轴方向上的偏移,默认是0。 更多...
 
real offsetY
 offsetY 属性定义阴影在y轴方向上的偏移,默认是0。 更多...
 
real glowRadius
 glowRadius 属性定义阴影到达项目区域外部(或内部)的像素数,默认是 0。 更多...
 
real spread
 spread 属性定义在源四周区域的阴影颜色的增强程度,默认是0 更多...
 
color color
 color 属性定义阴影颜色。 更多...
 
real cornerRadius
 cornerRadius 属性定义绘制阴影的控件的圆角大小。 更多...
 
alias fill
 fill 属性定义阴影是否填充整个区域。 更多...
 

详细描述

一种只支持硬件渲染模式的矩形阴影控件.

RectangularShadow 是 GlowEffect 应用形态,它重新整理了 GlowEffect 的各个属性,并将其修饰为 更容易理解的属性名称。 RectangularShadow 相对于 GlowEffect 更容易使用。 但 RectangularShadow 和 GlowEffect 都有同样的缺点:暂不支持使用软件渲染。因此使用这两种效果时 需要注意对不同渲染模式的适配。如果在使用中更倾向于软硬件的兼容,请使用: BoxShadow 效果。 RectangularShadow 和 GlowEffect 一样,都提供一种矩形阴影效果。RectangularShadow的 使用方式如下所示:

anchors.fill: shadowSource
spread: 0
color: "black"
cornerRadius: shadowSource.radius
}
Rectangle {
id: shadowSource
width: 120
height: 120
radius: 16
color: "red"
}
一种只支持硬件渲染模式的矩形阴影控件.
Definition: RectangularShadow.qml:6
real glowRadius
glowRadius 属性定义阴影到达项目区域外部(或内部)的像素数,默认是 0。
Definition: RectangularShadow.qml:13
real spread
spread 属性定义在源四周区域的阴影颜色的增强程度,默认是0
Definition: RectangularShadow.qml:15
alias fill
fill 属性定义阴影是否填充整个区域。
Definition: RectangularShadow.qml:21
real cornerRadius
cornerRadius 属性定义绘制阴影的控件的圆角大小。
Definition: RectangularShadow.qml:19
color color
color 属性定义阴影颜色。
Definition: RectangularShadow.qml:17

其效果如下图所示:

属性说明

◆ color

color RectangularShadow::color
read

color 属性定义阴影颜色。

This property defines the the shadow color.

◆ cornerRadius

real RectangularShadow::cornerRadius
read

cornerRadius 属性定义绘制阴影的控件的圆角大小。

This property defines corners size of the control that draws the shadow.

◆ fill

bool RectangularShadow::fill
read

fill 属性定义阴影是否填充整个区域。

This property defines does the shadow fill the entire area.

◆ glowRadius

real RectangularShadow::glowRadius
read

glowRadius 属性定义阴影到达项目区域外部(或内部)的像素数,默认是 0。

This property defines how many pixels outside(or inside) the item area are reached by the shadow.

◆ offsetX

real RectangularShadow::offsetX
read

offsetX 属性定义阴影在x轴方向上的偏移,默认是0。

This property defines the offset of the shadow in the x-axis direction.

◆ offsetY

real RectangularShadow::offsetY
read

offsetY 属性定义阴影在y轴方向上的偏移,默认是0。

This property defines the offset of the shadow in the y-axis direction.

◆ spread

real RectangularShadow::spread
read

spread 属性定义在源四周区域的阴影颜色的增强程度,默认是0

This property defines how large part of the shadow color is strengthened near the source edges.


该类的文档由以下文件生成: