1 Star 0 Fork 6

lzh280/admindemo

forked from lennyaaa/admindemo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
MenuTest.qml 3.69 KB
一键复制 编辑 原始数据 按行查看 历史
lennyaaa 提交于 2022-12-09 16:08 . 提交保存
import QtQuick 2.0
Item {
// id: menuDelegateLevel2
property var name;
property var icon;
width:800
height: 600
Rectangle {
id: level2
property bool isExpand: false
anchors.fill: parent
color: "#16181d"
MouseArea {
onClicked: {
}
}
MenuView{
id: item_tree
width: parent.width/2
anchors{
left: parent.left
top: parent.top
bottom: parent.bottom
margins: 10
}
//model: []
//set model data
Component.onCompleted: {
console.log(1)
//root_window.setTestDataA();
level2.setTestDataB();
console.log(2)
setMenuClicked("home")
}
onMenuClicked: function(name){
console.log("name " + name)
}
}
function setTestDataB(){
item_tree.model=JSON.parse(qsTr('
[
{
"name": "home",
"desc": "首页",
"icon": "image/home.png",
"toIndex": "FirstForm",
"subMenus":[]
},
{
"name": "config",
"desc": "系统配置",
"icon": "image/config.png",
"toIndex": "",
"subMenus":[
{
"name": "config1",
"desc": "系统配置1",
"icon": "",
"toIndex": "",
"subMenus":[]
},
{
"name": "config2",
"desc": "系统配置2",
"icon": "",
"toIndex": "",
"subMenus":[]
}]
},
{
"name": "app",
"desc": "系统应用",
"icon": "image/app.png",
"toIndex": "",
"subMenus":[
{
"name": "app1",
"desc":"应用配置1",
"icon":"",
"toIndex": "",
"subMenus":[
{
"name": "subapp1",
"desc":"子配置1",
"icon":"",
"toIndex": "",
"subMenus":[]
},
{
"name": "subapp2",
"desc":"子配置2",
"icon":"",
"toIndex": "",
"subMenus":[]
}
]
},
{
"name": "app2",
"desc":"应用配置2",
"icon":"",
"toIndex": "",
"subMenus":[]
}]
},
{
"name": "help",
"desc": "帮助",
"icon": "image/help.png",
"toIndex": "FirstForm",
"subMenus":[]
}
]'))
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/lzh280/admindemo.git
git@gitee.com:lzh280/admindemo.git
lzh280
admindemo
admindemo
master

搜索帮助