GradientStop
2015-07-17 10:13
204 查看
Properties
stops : list<GradientStop>
Detailed Description
A gradient is defined by two or more colors, which will be blended seamlessly.
The colors are specified as a set of GradientStop child items, each of which defines a position on the gradient from 0.0 to 1.0 and a color. The position of each GradientStop is defined by setting its position property; its color is defined using its color property.
A gradient without any gradient stops is rendered as a solid white fill.
Note that this item is not a visual representation of a gradient. To display a gradient, use a visual item (like Rectangle) which supports the use of gradients.
Example Usage
The following example declares a Rectangle item with a gradient starting with red, blending to yellow at one third of the height of the rectangle, and ending with green:
Rectangle {
width: 100; height: 100
gradient: Gradient {
GradientStop { position: 0.0; color: "red" }
GradientStop { position: 0.33; color: "yellow" }
GradientStop { position: 1.0; color: "green" }
}
}
Performance and Limitations
Calculating gradients can be computationally expensive compared to the use of solid color fills or images. Consider using gradients for static items in a user interface.
In Qt 5.0, only vertical, linear gradients can be applied to items. If you need to apply different orientations of gradients, a combination of rotation and clipping will need to be applied to the relevant items. This can introduce additional performance requirements for your application.
The use of animations involving gradient stops may not give the desired result. An alternative way to animate gradients is to use pre-generated images or SVG drawings containing gradients.
See also GradientStop.
Property Documentation
defaultstops : list<GradientStop>
This property holds the gradient stops describing the gradient.
By default, this property contains an empty list.
To set the gradient stops, define them as children of the Gradient.
stops : list<GradientStop>
Detailed Description
A gradient is defined by two or more colors, which will be blended seamlessly.
The colors are specified as a set of GradientStop child items, each of which defines a position on the gradient from 0.0 to 1.0 and a color. The position of each GradientStop is defined by setting its position property; its color is defined using its color property.
A gradient without any gradient stops is rendered as a solid white fill.
Note that this item is not a visual representation of a gradient. To display a gradient, use a visual item (like Rectangle) which supports the use of gradients.
Example Usage
The following example declares a Rectangle item with a gradient starting with red, blending to yellow at one third of the height of the rectangle, and ending with green:
Rectangle {
width: 100; height: 100
gradient: Gradient {
GradientStop { position: 0.0; color: "red" }
GradientStop { position: 0.33; color: "yellow" }
GradientStop { position: 1.0; color: "green" }
}
}
Performance and Limitations
Calculating gradients can be computationally expensive compared to the use of solid color fills or images. Consider using gradients for static items in a user interface.
In Qt 5.0, only vertical, linear gradients can be applied to items. If you need to apply different orientations of gradients, a combination of rotation and clipping will need to be applied to the relevant items. This can introduce additional performance requirements for your application.
The use of animations involving gradient stops may not give the desired result. An alternative way to animate gradients is to use pre-generated images or SVG drawings containing gradients.
See also GradientStop.
Property Documentation
defaultstops : list<GradientStop>
This property holds the gradient stops describing the gradient.
By default, this property contains an empty list.
To set the gradient stops, define them as children of the Gradient.
相关文章推荐
- tomcat
- 如何删除ecshop 商品的市场售价
- PHP+Apache如何监控多个端口和配置多站点
- 推荐几个网站
- linux 线程编程详解
- linux下一个php未找到php型材php.ini解决方案
- 当装了两个tomcat后,如何修改tomcat端口
- linux 批量kill php进程
- Linux : ctrl+c和ctrl+z区别
- 修改linux上面时间的方法
- solr CopyField 解释
- centos6.5适用的国内yum源:网易、搜狐
- U盘安装LINUX系统,拔除U盘后无法引导系统
- 关于 linux disable irq
- Amber14在Centos6.6下的安装
- tomcat官网下载选项说明
- 玩转 Linux 之:磁盘分区、挂载知多少?
- windows下如何查看tomcat是32位还是64位
- CentOS安装与更新git
- 安装virtualbox的增强功能出现virtualbox kernel service not running