Qt Quick中布局管理

本文介绍了Qt Quick中的布局管理,包括Rectangle属性、Column、Row、Grid、Flow布局的使用,以及anchors和Layouts布局管理器的功能。通过示例代码展示了各种布局方式,详细解释了布局属性和效果。
摘要由CSDN通过智能技术生成

自己博客中的代码可以在https://github.com/xixihaha331/QT_Repository中获取

1.Rectangle

属性:id;text;color;width;height;
border.color 边框颜色
border.width边框宽度
opacity 透明度
radius 绘制圆形
gradient 渐变色

1.1Rectangle示例

import QtQuick 2.8
import QtQuick.Window 2.2

Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Rectangle example")
    Item{
        Rectangle{
            width: 400
            height: 400
            border.color: "red"
            border.width: 3
            color: "green"
            opacity: 0.3
            radius: width/2
            gradient:Gradient{
                GradientStop{
                    position: 0.0
                    color: "green"
                }
                GradientStop{
                    position: 0.4
                    color: "yellow"
                }
                GradientStop{
                    position
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值