国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

QML所有的元素三

2019-11-08 02:07:32
字體:
來源:轉載
供稿:網友
MouseArea

主要是用來判斷鼠標事件的區域

Rectangle{

x: 0; y: 0;

width: 100; height:100;

Rectangle{

id: mousrect

x: 20; y: 20;

width: 20; height: 20;

color: “blue”

MouseArea{

// 使用父的區域作為鼠標判斷的區域及 x: 20; y: 20; width: 20; height: 20;

anchors.fill: parent;

// 但鼠標按下后 mousrect變成紅色,當鼠標松開后變成藍色

onPRessed: { mousrect.color =”red”;}

onReleased: { mousrect.color =”blue”;}

}

}

}

FocusScope

不是很清楚說的什么,好像是說同一個時刻只有一個item有焦點

Flickable

顯示一個200x200的框,框中顯示圖片上200x200的部分

Flickable {

width: 200; height: 200

// 設置使用圖片的寬高,而現實的是 200x200的現實框

contentWidth: image.width; contentHeight:image.height

Image { id: image; source:”../Images/need.png” }

}

Flipable

包含兩個面,一個前面,一個后面,實現一個控件前后的翻轉效果,并且在后面可以添加一些控制

Flipable {

id: flipable

width: 240

height: 240

property int angle: 0

property bool flipped: false

front: Image {source: “front.png” } // 前面

back: Image { source: “back.png”} // 后面

// 旋轉動畫前后面交換

transform: Rotation {

origin.x: flipable.width/2; origin.y:flipable.height/2

axis.x: 0; axis.y: 1; axis.z: 0 // rotatearound y-axis

angle: flipable.angle

}

states: State {

name: “back”

PropertyChanges { target: flipable; angle:180 }

when: flipable.flipped

}

transitions: Transition {

NumberAnimation { properties:”angle”; duration: 1000 }

}

MouseArea {

anchors.fill: parent

onClicked: flipable.flipped =!flipable.flipped

}

}

State

// 當鼠標按下后改變 myRect 的顏色

Rectangle {

id: myRect

width: 100; height: 100

color: “black”

MouseArea {

id: mouseArea

anchors.fill: parent

onClicked: myRect.state == ‘clicked’ ?myRect.state = “” : myRect.state = ‘clicked’;

}

// 設置狀態

states: [

State {

name: “clicked”

PropertyChanges { target: myRect; color:”red” }

}

]

}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 海林市| 苍溪县| 梅州市| 博白县| 新民市| 邯郸县| 木里| 邻水| 西乌珠穆沁旗| 云阳县| 思南县| 陵川县| 茌平县| 恩施市| 新营市| 塘沽区| 马关县| 堆龙德庆县| 建瓯市| 大宁县| 天峻县| 恩施市| 同心县| 嵊泗县| 正蓝旗| 什邡市| 武山县| 板桥市| 余江县| 桓台县| 丹巴县| 五家渠市| 印江| 巴林右旗| 安图县| 收藏| 广丰县| 巫溪县| 甘谷县| 高邮市| 景洪市|