QML Rectangle 圆形 矩形画圆
Window {
width: 640 //宽度
height: 480 //高度
visible: true //是否可见
title: qsTr("Hello World") //窗口标题
color: "#ffffff" //窗口背景色
flags: Qt.Window //窗口标志\类型 说明是什么窗口
opacity: 1 //透明度 数值区间为0~1 支持小数
Rectangle {
x: 0; // 位于父窗体的x位置,以左上角为起点,缺省为0
y: 0; // 位于父窗体的y位置,以左上角为起点,缺省为0
width: 200; // 宽度,此时Rectangle控件在Window控件内,属于Window的孩子,可以使用parent继承
height: 200; // 高度,此时Rectangle控件在Window控件内,属于Window的孩子,可以使用parent
color: "blue"; // 颜色,缺省为白色
opacity: 0.5; // 透明度,缺省为1
radius: 100; // 圆角,通过圆角来画出一个圆形窗体出来
clip: true; // 截断,在Rectangle控件内的子控件,超出他本身大小后会被截断
}
}
效果:
上一篇 : QML Rectangle 背景填充矩形
觉得有用的请点个赞~ 拜谢