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"}
}
}
}