QML学习笔记之二

 

 1 //必须要导入,否则以下元素将无效
 2 import QtQuick 1.1
 3 
 4 //对象一:矩形Rectangle
 5 Rectangle {
 6     width: 798
 7     height: 111
 8     //整个Rectangle的背景色
 9     color:"gray"
10     //对象二:图像Image
11     Image{
12         source: "images/main_frame/background.png"
13         //位于调试工具窗口中央部分
14         anchors.centerIn: parent
15     }
16 }
 1 import QtQuick 1.1
 2 
 3 Item{
 4     Text{
 5         id:text1
 6         text:"hello world"
 7     }
 8     Text{
 9         id:text2
10         text:text1.text
11     }
12 }
1 Text{
2         id:text1
3         text:"hello world"
4         opacity: 0.5
5     }

 

 1 Item{
 2     Text{
 3         id:text1
 4         text:"hello world"
 5         opacity: 0.5
 6     }
 7     //Defines the item's position and size relative to its parent.
 8     x:10.5 //a 'real' property
 9     //This property holds the name of the current state of the item.
10     state: "datail" // a 'string' property
11     focus: true // a 'bool' property
12 }

 

转载于:https://www.cnblogs.com/wangzhiyu811/p/3199771.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值