QML中Column的使用及示例
来源:互联网 发布:无间道刘建明知乎 编辑:程序博客网 时间:2024/05/18 14:11
其实它和Row是相同的,依旧是添加五个按钮:
import QtQuick 2.3import QtQuick.Window 2.2import QtQuick.Controls 1.4Window { visible: true width: 300 height: 300 Rectangle{ anchors.fill: parent Column{ anchors.left: parent.left anchors.leftMargin: 4 anchors.bottom: parent.bottom anchors.bottomMargin: 4 Button{ id:button1 text:qsTr("按钮1") } Button{ id:button2 text:qsTr("按钮2") } Button{ id:button3 text:qsTr("按钮3") } Button{ id:button4 text:qsTr("按钮4") } Button{ id:button5 text:qsTr("按钮5") } } } }
要是非要找点不同,那就是位置了,看效果图:
从图上可以看出,按钮5是在最下面的。
我们的代码想要表达的意思是布局从左下角开始,没错,这里的布局也就从左下角开始了。QT自动为我们进行了优化,使得按钮1在最上面,按钮5在最下面,而且位置非常恰当。
0 0
- QML中Column的使用及示例
- QML中ROW组件的使用方法及示例
- QML中webview元素的javaScriptWindowObjects的使用示例
- 创建及调用基于QT5 QML的 DLL(举例QML中使用QZXing识别二维码)
- BB10 Cascades: QML中Label的使用。
- QML中使用JavaScript的一些总结
- QML中信号槽机制的使用
- qml中action属性的使用
- QML中使用C++的枚举类型
- 在QML webview中使用alert及confirm Dialogs
- QML中使用JavaScript
- QML中使用随机数
- qt中使用QML
- QML中Rectangle QML的透明度、旋转、缩放、渐变及Animation and Transitions
- QML类型说明-Column
- Java中split函数的用法及使用示例
- golang语言中map的初始化及使用:代码示例
- 在QML中使用定时器
- C-C++字符输出时遇到字符'\n','\0'区别
- 当前日志损坏(ACTIVE,CURRENT),数据库正常关闭
- 内存优化
- Linux系统下的软件安装方式
- Shell基础(五):条件判断与流程控制
- QML中Column的使用及示例
- hdu4121 Xiangqi && uva1589 Xiangqi (模拟)
- 斐波那契数列V(原创题)
- librtmp 时间戳超过 0xffffff时,FMS掉连接
- Android Material Design(4) CoordinatorLayout,AppBarLayout,Toolbar以及TabLayout的使用
- 2015年大二上-数据结构-内部排序-(2)-希尔排序
- [LeetCode]154. Find Minimum in Rotated Sorted Array II
- Java的各种操作
- VC++与Matlab混合编程之引擎操作详解