首页 > 其他分享 >qml教程-3-锚点anchor布局

qml教程-3-锚点anchor布局

时间:2022-10-09 16:33:58浏览次数:35  
标签:anchors color height width 锚点 id anchor Rectangle qml


import QtQuick 2.15

Window {
width: 400
height: 600
visible: true

Rectangle {
anchors.fill: parent
color: 'yellowgreen'
}
}

qml教程-3-锚点anchor布局_html

import QtQuick 2.15

Window {
width: 300
height: 500
visible: true

// Rectangle {
// anchors.fill: parent
// color: 'yellowgreen'
// }

Rectangle {
id: rect1
width: 100
height: 50
color: 'pink'
}

Rectangle {
id: rect2
width: 100
height: 50
color: 'green'
anchors.left: rect1.right
}
}

qml教程-3-锚点anchor布局_html_02

import QtQuick 2.15

Window {
width: 300
height: 500
visible: true

// Rectangle {
// anchors.fill: parent
// color: 'yellowgreen'
// }

Rectangle {
id: rect1
width: 100
height: 50
color: 'pink'
}

Rectangle {
id: rect2
width: 100
height: 50
color: 'green'
anchors.left: rect1.right
anchors.leftMargin: 20
}

Rectangle {
id: rect3
width: 100
height: 50
color: 'green'
anchors.top: rect1.bottom
anchors.topMargin: 20
}
}

qml教程-3-锚点anchor布局_javascript_03

import QtQuick 2.15

Window {
width: 300
height: 500
visible: true

Rectangle {
id: rect1
width: 100
height: 50
color: 'pink'
}

Rectangle {
id: rect2
width: 100
height: 50
color: 'green'
anchors.left: rect1.right
anchors.leftMargin: 20
}

Rectangle {
id: rect3
width: 100
height: 50
color: 'green'
anchors.top: rect1.bottom
anchors.topMargin: 20
}

Rectangle {
id: rect4
width: 100
height: 50
color: 'blue'
anchors.centerIn: parent
}

}

qml教程-3-锚点anchor布局_html_04

import QtQuick 2.15

Window {
width: 300
height: 500
visible: true

Rectangle {
id: rect1
width: 100
height: 50
color: 'pink'
}

Rectangle {
id: rect2
width: 100
height: 50
color: 'green'
anchors.left: rect1.right
anchors.leftMargin: 20
}

Rectangle {
id: rect3
width: 100
height: 50
color: 'green'
anchors.top: rect1.bottom
anchors.topMargin: 20
}

Rectangle {
id: rect4
width: 100
height: 50
color: 'blue'
anchors.centerIn: parent

rotation: 20
}

}

qml教程-3-锚点anchor布局_html_05

import QtQuick 2.15

Window {
width: 300
height: 500
visible: true

Rectangle {
id: rect1
width: 100
height: 50
color: 'pink'
}

Rectangle {
id: rect2
width: 100
height: 50
color: 'green'
anchors.left: rect1.right
anchors.leftMargin: 20
}

Rectangle {
id: rect3
width: 100
height: 50
color: 'green'
anchors.top: rect1.bottom
anchors.topMargin: 20
}

Rectangle {
id: rect4
width: 100
height: 50
color: 'blue'
anchors.centerIn: parent

// rotation: 20
// antialiasing: true
border.width: 10
border.color: black
}

}


标签:anchors,color,height,width,锚点,id,anchor,Rectangle,qml
From: https://blog.51cto.com/u_12836588/5740703

相关文章

  • qml教程-3-Item,Rectangle
    importQtQuick2.15Window{width:400height:600visible:trueRectangle{x:100y:100width:100height:100......
  • 干货实践 | Anchor优化后在目标检测提升这么明显
    “计算机视觉研究院”计算机视觉研究院专栏作者:Edison_G目标检测发展已经到了一个瓶颈,但是依然有很多优秀的产出,比如最近比较火热的“Anchor—Free”,貌似在该机制下精度有一......
  • QML 信号与响应方法的总结
    以下内容为本人的著作,如需要转载,请声明原文链接微信公众号「englyf」https://www.cnblogs.com/englyf/p/16748191.html如果面试过程中,面试官想了解你对Qt的理解有多少......
  • WLC Anchor认证发生的位置
    Foreign/AnchorScenariobetween9800WLCsFormobilityguestscenarios,thereare twomaincontrollerroles:Foreigncontroller:thisWLCownsthelayer2......
  • qmlRegisterType 注册C++类型出现 module not fount
    使用 qmlRegisterSingletonType或 qmlRegisterType想QML注册C++类,按照使用文档上方法添加如下:qmlRegisterSingletonType<CProtoInfoModel>("LdpModel",1,0,"p......
  • 用C++ 编写QML 扩展
    用C++编写QML扩展Qt,QML,QtQuick这是关于用C++来扩展QML的教程。源文:WritingQMLExtensionswithC++QtQML模块提供了一系列API以实现通过C++来扩展QML。可以编写扩......
  • anchor free与anchor box
    常见面试问题10:anchorbox与anchorfree_哔哩哔哩_bilibilianchorbox是从FastRCNN开始出现的。  预测左上角坐标和右下角坐标,根据这个计算损失,进行训练。关键点也......
  • QML
    QML是一种脚本语言。qtquick是QML语言的库,暂且可以这么理解。QML用来声明UI元素,并可以做逻辑处理,可以理解为html+javascript,比如在窗体上放置一个按钮:importQtQuic......
  • 什么是 CALayer 的 AnchorPoint?
    什么是CALayer的AnchorPoint?如果您想在该层上进行任何类型的几何变换,CALayer的AnchorPoint是一个重要的属性。读官方文档。根据Apple的说法:anchorPoint“定......
  • 【转载】Qt6.2.4 qml ChartView 实现饼状图与问题解决
    转载https://www.bilibili.com/video/BV1dS4y1u7vN?p=30&vd_source=64f1a4c05d797eb3cca1ef771fd46c22环境环境版本windows10QT6.2.4QtCreator8.0......