首页 > 其他 > 详细

qml 锚点demo2

时间:2021-05-16 01:19:11      阅读:12      评论:0      收藏:0      [点我收藏+]
Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    Item {
        anchors.fill: parent
        Rectangle {
            id: rectLeft
            anchors.left: parent.left
            anchors.top: parent.top
            anchors.bottom: parent.bottom
            width: parent.width/3
            color: "red"
        }
        Rectangle {
            id: rectCenter
            /*
            anchors.horizontalCenter: parent.horizontalCenter
            */
            anchors.left: rectLeft.right
            anchors.top: parent.top
            anchors.bottom: parent.bottom
            width: parent.width/3
            color: "green"
        }
        Rectangle {
            id: rectRight
            anchors.left: rectCenter.right
            anchors.right: parent.right
            anchors.top: parent.top
            anchors.bottom: parent.bottom
//            width: parent.width/3
            color: "yellow"
        }
        /*
        Rectangle {
            id: rectRight
            anchors.right: parent.right
            anchors.top: parent.top
            anchors.bottom: parent.bottom
            width: parent.width/3
            color: "yellow"
        }
        */
    }
}

qml 锚点demo2

原文:https://www.cnblogs.com/lodger47/p/14772930.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!