104 lines
5.0 KiB
QML
104 lines
5.0 KiB
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import QtQuick.Controls
|
|
import FluentUI.Controls
|
|
import FluentUI.impl
|
|
import Gallery
|
|
import "../component/base"
|
|
|
|
Item {
|
|
property var pro_title: ""
|
|
|
|
id: control
|
|
|
|
Connections{
|
|
target: window
|
|
function onInit(arg){
|
|
console.log("初始化。。。")
|
|
}
|
|
}
|
|
|
|
MyTreeView {
|
|
anchors.fill: parent
|
|
id: tree
|
|
model: modelTree2
|
|
onSelectedItemChanged: console.log(item.text)
|
|
}
|
|
ListModel {
|
|
id: modelTree2
|
|
Component.onCompleted: {
|
|
modelTree2.append([
|
|
{id: "1", title: "Node 1", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
{id: "2", title: "Node 2", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: [
|
|
{id: "21", title: "Node 21", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items:[
|
|
{id: "211", title: "Node 211", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_car.png", items: []},
|
|
{id: "212", title: "Node 212", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_car.png", items: []}
|
|
]},
|
|
{id: "22", title: "Node 22", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_line.png", items: []}
|
|
]
|
|
},
|
|
{id: "3", title: "Node 3", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
{id: "4", title: "多文字多文字多文字多文字多文字多文字多文字多文字多文字多文字多文字多文字", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
{id: "31", title: "Node 3", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
{id: "32", title: "Node 3", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
{id: "33", title: "Node 3", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
{id: "34", title: "Node 3", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
{id: "35", title: "Node 3", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
{id: "36", title: "Node 3", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
{id: "37", title: "Node 3", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
{id: "38", title: "Node 3", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
{id: "39", title: "Node 3", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
{id: "30", title: "Node 3", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
{id: "300", title: "Node 3", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
{id: "3000", title: "Node 3", ico: "qrc:/qt/qml/Gallery/res/image/components/ico_tree_folder.png", items: []},
|
|
]);
|
|
}
|
|
}
|
|
|
|
|
|
// ColumnLayout {
|
|
// spacing: 20
|
|
// anchors.centerIn: parent
|
|
// width: 260
|
|
// Label {
|
|
// elide: Label.ElideRight
|
|
// text: "新建目录"
|
|
// Layout.fillWidth: true
|
|
// font.pointSize: 15
|
|
// horizontalAlignment: Text.AlignHCenter
|
|
// }
|
|
// TextField {
|
|
// id: tb_title
|
|
// focus: true
|
|
// placeholderText: "名称"
|
|
// Layout.fillWidth: true
|
|
// text: control.pro_title
|
|
// }
|
|
// Item{
|
|
// implicitHeight: 40
|
|
// Layout.fillWidth: true
|
|
// Button{
|
|
// text: "取消"
|
|
// anchors{
|
|
// left: parent.left
|
|
// verticalCenter: parent.verticalCenter
|
|
// }
|
|
// onClicked: {
|
|
// window.close()
|
|
// }
|
|
// }
|
|
// FilledButton{
|
|
// text: "确认"
|
|
// anchors{
|
|
// right: parent.right
|
|
// verticalCenter: parent.verticalCenter
|
|
// }
|
|
// onClicked: {
|
|
// window.setResult({title: tb_title.text})
|
|
// window.close()
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
}
|