加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
TitleLeftBar.qml 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
世玉轩 提交于 2020-06-19 09:31 . init push myir hmi v2.0 gui
import QtQuick 2.0
import QtQuick.Window 2.2
Rectangle {
id: leftbar
property int adaptive_width: Screen.desktopAvailableWidth
property int adaptive_height: Screen.desktopAvailableHeight
width: adaptive_width/2.6
height:adaptive_height/15
color: Qt.rgba(0,0,0,0)
anchors{
left: parent.left
leftMargin: 10
top:parent.top
topMargin: 10
}
signal leftBarClicked
property string titleIcon: "images/wvga/home/header_logo.png"
property string titleName: "hello world"
property real titleIconWidth: 100
property real titleIconHeight: 16
property real titleNameSize: 20
HomeButton{
id: logo
width: titleIconWidth
height: titleIconHeight
anchors{
left: parent.left
top: parent.top
}
label.visible: false
clickable: true
source: titleIcon
onClicked: {
leftBarClicked();
}
}
Text {
id: name
text: titleName
anchors{
left: logo.right
leftMargin: 16
}
horizontalAlignment: Text.AlignHCenter
color: "#dcdde4";
font.family: "Microsoft YaHei";
font.pixelSize: titleNameSize;
wrapMode: Text.Wrap;
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化