qml颜色渐变

xiaoxiao2021-02-28  90

import QtQuick 2.5 import QtQuick.Window 2.2 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") Rectangle { width: 500 height: 400 anchors.left: parent.left anchors.leftMargin: 70 anchors.top: parent.top anchors.topMargin: 40 //颜色渐变 gradient:Gradient { GradientStop {position: 0.0; color: "green"} GradientStop {position: 0.5; color: "red"} GradientStop {position: 1.0; color: "gray"} } } }

 

转载请注明原文地址: https://www.6miu.com/read-33208.html

最新回复(0)