1 //必须要导入,否则以下元素将无效 2 import QtQuick 1.1 3 4 //对象一:矩形Rectangle 5 Rectangle { 6 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 }