QTQUICK – Rectangle
import QtQuick
window
{
width:640
height:480
visible:true
title:qsTr("Rectangle使用")
Rectangle
{
id:标识号
width:100
height:100
x:10
y:10
color:"red"
//anchors.bottom:parent.bottom对齐位置
border.color:"black"
border.width:1
border.pixelAligned:true//宽度四舍五入到整数像素数
bottomLeftRadius:2//左下圆角值
bottomRightRadius:2//右下
topLeftRadius:2//左上
topRightRadius:2//右上圆角值
radius:2//总圆角值,当四周不设置时,总设置包括四周,如果每个角的弧度不同时,可分别设置
gradient:Gradient{GradientStop{position:0.0;color:"red"},GradientStop{position:1.0;color:"blue"}}
//允许构建简单的垂直或水平渐变Gradient.NightFade
antialiasing:true//用于决定矩形是否使用抗锯齿
}
}
本节是Rectangle,其他为辅助
QT新手日记032
相关推荐
Python ai-economist 包实战案例与常见错误
从告警风暴到根因定位:Java + Vue 指标异常检测与拓扑溯源系统全链路实战 动态基线 · 多指标联动 · 服务依赖图 · 可解释根因排序
深入理解Scala匿名函数:函数式编程基石
C++ 中 map 的 insert 与 emplace:key 已存在时会覆盖吗?
ABAP Development Tools 3.62 搭配 Claude Code,已经从旁路方案走到了 SAP 官方 MCP 路线
MSVCP71.DLL丢失怎么办?官方修复流程与单文件下载风险详解
一键暂停系统自动更新工具小到几乎不占空间
【PINN系列&Python实现】A1 统一实验框架与复现规范:从零搭建可复用的 1D Burgers PINN
网硕互联帮助中心





评论前必须登录!
注册