This commit is contained in:
朱子楚\zhuzi
2024-04-14 23:09:41 +08:00
parent f701f97756
commit 295dcf02c4
6 changed files with 31 additions and 88 deletions

View File

@ -2394,25 +2394,25 @@ Some contents...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="230"/>
<location filename="qml/page/T_TreeView.qml" line="184"/>
<source>Title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="238"/>
<location filename="qml/page/T_TreeView.qml" line="188"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="192"/>
<source>Avatar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="242"/>
<location filename="qml/page/T_TreeView.qml" line="196"/>
<source>Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="234"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>T_Typography</name>

View File

@ -2504,22 +2504,22 @@ Some contents...</source>
<translation type="obsolete">共计选中%1条数据</translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="230"/>
<location filename="qml/page/T_TreeView.qml" line="184"/>
<source>Title</source>
<translation type="unfinished">标题</translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="242"/>
<location filename="qml/page/T_TreeView.qml" line="196"/>
<source>Address</source>
<translation type="unfinished">地址</translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="238"/>
<location filename="qml/page/T_TreeView.qml" line="192"/>
<source>Avatar</source>
<translation type="unfinished">头像</translation>
</message>
<message>
<location filename="qml/page/T_TreeView.qml" line="234"/>
<location filename="qml/page/T_TreeView.qml" line="188"/>
<source>Name</source>
<translation type="unfinished">名称</translation>
</message>

View File

@ -10,7 +10,6 @@ FluContentPage {
title: qsTr("TreeView")
function treeData(){
const names = ["孙悟空", "猪八戒", "沙和尚", "唐僧","白骨夫人","金角大王","熊山君","黄风怪","银角大王"]
function getRandomName(){
@ -48,67 +47,6 @@ FluContentPage {
return dig();
}
// Row{
// id: layout_column
// spacing: 12
// width: 340
// anchors{
// top:parent.top
// left: parent.left
// leftMargin: 10
// bottom:parent.bottom
// bottomMargin: 20
// }
// RowLayout{
// spacing: 10
// FluText{
// text: "cellHeight:"
// Layout.alignment: Qt.AlignVCenter
// }
// FluSlider{
// id: slider_cell_height
// value: 30
// from: 30
// to:100
// }
// }
// RowLayout{
// spacing: 10
// FluText{
// text: "depthPadding:"
// Layout.alignment: Qt.AlignVCenter
// }
// FluSlider{
// id: slider_depth_padding
// value: 15
// from: 15
// to:100
// }
// }
// FluToggleSwitch{
// id: switch_showline
// text:"showLine"
// checked: false
// }
// FluToggleSwitch{
// id: switch_checkable
// text:"checkable"
// checked: false
// }
// FluButton{
// text: "all expand"
// onClicked: {
// tree_view.allExpand()
// }
// }
// FluButton{
// text: "all collapse"
// onClicked: {
// tree_view.allCollapse()
// }
// }
// }
Component{
id:com_avatar
Item{
@ -206,7 +144,20 @@ FluContentPage {
}
}
}
FluButton{
text: "print selection model"
onClicked: {
var printData = []
var data = tree_view.selectionModel
for(var i = 0; i <= data.length-1 ; i++){
const newObj = Object.assign({}, data[i].data);
delete newObj["__parent"];
delete newObj["children"];
printData.push(newObj)
}
console.debug(JSON.stringify(printData))
}
}
}
}
@ -225,6 +176,9 @@ FluContentPage {
showLine: switch_showline.checked
checkable:switch_checkable.checked
depthPadding: slider_depth_padding.value
onCurrentChanged: {
showInfo(current.data.title)
}
columnSource:[
{
title: qsTr("Title"),