本页内容

LinearGradient QML Type

线性渐变。更多...

Import Statement: import QtQuick.Shapes 1.12
Inherits:

ShapeGradient

属性

  • x1 : real
  • x2 : real
  • y1 : real
  • y2 : real

详细说明

线性渐变会在“形状”项的起始点和终点之间对颜色进行插值。在这些点之外,渐变会根据扩展类型进行填充、镜像或重复。

注意:LinearGradient 仅支持与“形状”控件结合使用。它与Rectangle 不兼容,因为后者仅支持Gradient 。

另请参阅 QLinearGradient 。

属性文档

x1 : real

x2 : real

y1 : real

y2 : real

这些属性定义了颜色插值所涉及的起始点和终点。默认情况下,这两个点均设置为 (0, 0)。

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