国产探花免费观看_亚洲丰满少妇自慰呻吟_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” }

}

]

}


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 开鲁县| 胶南市| 永登县| 永川市| 新野县| 磐安县| 万荣县| 小金县| 五大连池市| 沿河| 赤壁市| 宜兰县| 金秀| 汉中市| 旬阳县| 陵水| 安宁市| 普陀区| 阿巴嘎旗| 正镶白旗| 扶风县| 鱼台县| 楚雄市| 隆昌县| 易门县| 乾安县| 邵东县| 墨竹工卡县| 特克斯县| 平潭县| 福建省| 翁牛特旗| 东阳市| 潞西市| 武城县| 边坝县| 中超| 桦川县| 莫力| 含山县| 井冈山市|