zoukankan      html  css  js  c++  java
  • GradientStop

    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

    image

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

  • 相关阅读:
    [教程]北京迅为iMX6ULL开发板上配置 AP 热点
    [QT进阶篇]迅为手把手视频教程嵌入式学习之QT进阶篇
    新手学习嵌入式Linux和Android开发板推荐
    【迅为免费教程】 嵌入式学习之Linux入门篇分享
    迅为 iTOP-i.MX6ULL 开发板-Mqtt 移植教程
    9月29日学习日志
    9月8日学习日志
    9月7日学习日志
    9月6日学习日志
    9月5日学习日志
  • 原文地址:https://www.cnblogs.com/yechuang/p/4653632.html
Copyright © 2011-2022 走看看