QML类型:LayoutMirroring(布局镜像)

一、描述

LayoutMirroring 附加属性用于水平镜像 Item 锚点、定位器类型、视图。

镜像是一种视觉上的变化:左锚点变成右锚点,定位器类型反转子项的水平布局。

LayoutMirroring 可以附加到 Window 窗口。

    Rectangle 
    {
//        LayoutMirroring.enabled: true
//        LayoutMirroring.childrenInherit: true

        anchors.fill: parent
        color: "yellow"
        border.width: 1

        Row
        {
            anchors { left: parent.left; margins: 5 }
            y: 5; spacing: 5

            Repeater
            {
                model: 5

                Rectangle
                {
                    color: "red"
                    opacity: (5 - index) / 5
                    width: 40; height: 40

                    Text
                    {
                        text: index + 1
                        anchors.centerIn: parent
                    }
                }
            }
        }
    }

        LayoutMirroring.enabled: true
        LayoutMirroring.childrenInherit: true

二、属性成员

1、childrenInherit : bool

此项的 LayoutMirroring.enabled 值是否由其子项继承。默认值为 false。

2、enabled : bool

此属性保存项目的布局是否水平镜像。将此设置为 true 水平反转锚点设置,使左锚点变为右,右锚点变为左。默认值为 false。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值