Button实现边界隐藏

来源:互联网 发布:远程登陆阿里云服务器 编辑:程序博客网 时间:2024/05/29 17:43
import QtQuick 2.0import QtQuick.Window 2.0import QtQuick.Controls 1.3import QtQuick.Controls.Styles 1.4Window{    title:"xuanfuanniu"    width: 400    height: 200    x:400    y:200    color:"white"    visible: true    Button {        id:rec        property alias rec: rec        width:rec.hovered?30:5        height:80        anchors.verticalCenter:parent.verticalCenter        anchors.right:parent.right       style:ButtonStyle{            background: Rectangle{                color:(control.pressed||control.hovered)?"green":"#11262B"            }}        onClicked: {            //rec.width=200            console.log("the Button is Clicked!");        }    }}
多按F1查看元素的属性很重要!
原创粉丝点击