qml Rectangle中clip属性效果
来源:互联网 发布:amd ryzen游戏优化 编辑:程序博客网 时间:2024/06/03 04:51
import QtQuick2.2
Rectangle {
id: root
width: 800;
height: 600
Rectangle {
id: side
anchors {
top: parent.top
left: parent.left
}
width: 80
height: 80
color: "lightblue"
Text {
id: test
anchors.centerIn: parent
text: "测试"
}
MouseArea {
anchors.fill: parent
onClicked: {
if (root.state == '')
root.state = "minSize"
else
root.state = ''
}
}
}
Rectangle {
id: menu
width: 400
height: 100
color: "red"
anchors.left: side.right
anchors.top: parent.top
//没有这个属性com1,com2不会跟着收缩
clip: true
Rectangle {
id: com1
width: 30
height: 50
color: "green"
anchors.left: parent.left
anchors.top: parent.top
}
Rectangle {
id: com2
width: 30
height: 50
color: "gray"
anchors.left: parent.left
anchors.top: parent.top
anchors.leftMargin: 30
}
}
states:[
State {
name: "minSize"
PropertyChanges {
target: menu
height: 10
}
}
]
transitions: [
Transition {
NumberAnimation {
target: menu
property: "height";
duration: 200;
easing.type: Easing.InOutQuad;
}
}
]
}
运行效果
点击测试按钮
注释 clip:true
点击测试按钮
menu矩形里的com1,com2不会跟着收缩矩形里的
0 0
- qml Rectangle中clip属性效果
- QML中Rectangle的用法和属性
- QML之Rectangle属性
- css中clip属性
- css中clip属性
- CSS3中clip属性
- css3中clip属性
- clip属性
- clip属性
- CSS中内容的剪切属性clip
- 将CSS CLIP属性应用在:扩展覆盖效果
- 用css clip属性制作漂亮的环形效果
- QML 基础类型 - Rectangle
- QML基础之Rectangle
- QML中Rectangle QML的透明度、旋转、缩放、渐变及Animation and Transitions
- CSS clip元素 rect属性中各个数字的含义
- clip属性详解
- WPF Clip属性
- java String
- [C# 网络编程系列]专题五:TCP编程
- 谷歌上不去了,长久解决方案。可以稳定快速上Google和Gmail
- Stream.Read 方法
- 终端ssh使用
- qml Rectangle中clip属性效果
- 浅议指针
- 移动前端开发人员必知必会:移动设备概述
- OC-内存管理的一些要点
- queue用法
- Stream.Write 方法
- Thoughts of learning data structure
- 试装memcachedb、memcacheq,整理了下安装过程
- Web_JavaScript_JS邮件发送;