1 Star 0 Fork 6

lzh280/admindemo

forked from lennyaaa/admindemo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ContentForm.qml 3.57 KB
一键复制 编辑 原始数据 按行查看 历史
lennyaaa 提交于 2022-12-09 16:08 . 提交保存
import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
Item {
width: 800
height: 600
property alias mTabView: tab_view
Rectangle{
anchors.fill: parent
color: "#fafafa"
TabView {
id: tab_view
anchors.fill: parent
Tab {
id: tab1
anchors.fill: parent
title: qsTr("首页")
active: true
FirstForm {
property string name: "home"
anchors.fill: parent
}
}
style: TabViewStyle{
frameOverlap: 1
tab: Rectangle {
id: rctMain
color: styleData.selected ? "#f3f3f4" :"#ffffff"
implicitWidth: Math.max(text.width + 60, 120)
implicitHeight: 40
border.color: "#cdc5c5"
border.width: 1
radius: 0
Rectangle {
id: rctClose
width: 32
anchors.right: parent.right
anchors.rightMargin: 1
anchors.top: parent.top
anchors.topMargin: 1
anchors.bottom: parent.bottom
anchors.bottomMargin: 1
color:"#00000000"
visible: styleData.index !== 0
Image {
id:imgClose
width: 12
height: 12
anchors.centerIn: parent
source: "image/close-normal.png"
states: [
State {
name: "NORMAL"
PropertyChanges { target: imgClose; source: "image/close-normal.png" }
},
State {
name: "HOVER"
PropertyChanges { target: imgClose; source: "image/close-hovered.png" }
}
]
}
MouseArea {
hoverEnabled: true
anchors.fill: parent
onEntered: {
imgClose.state = "HOVER";
}
onExited: {
imgClose.state = "NORMAL";
}
onClicked: {
console.log("title:" + styleData.title);
console.log("index:" + styleData.index);
tab_view.removeTab(styleData.index);
}
}
}
Text {
id: text
anchors.centerIn: parent
text: styleData.title
color: styleData.selected ? "#23508e" : "#999"
font.family: "Alibaba PuHuiTi R"
font.pixelSize: 13
}
}
frame: Rectangle { //
color: "#f3f3f4"
border.color: "#cdc5c5"
border.width: 1
}
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/lzh280/admindemo.git
git@gitee.com:lzh280/admindemo.git
lzh280
admindemo
admindemo
master

搜索帮助