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"),

View File

@ -161,19 +161,12 @@ void FluFrameless::componentComplete() {
if (!isCompositionEnabled()) {
offsetSize = 0;
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (!isMaximum) {
clientRect->top = originalTop + offsetSize;
clientRect->bottom = originalBottom;
clientRect->left = originalLeft;
clientRect->right = originalRight;
}
#else
clientRect->top = originalTop + offsetSize;
clientRect->bottom = originalBottom;
clientRect->left = originalLeft;
clientRect->right = originalRight;
#endif
_setMaximizeHovered(false);
*result = WVR_REDRAW;
return true;

View File

@ -12,6 +12,7 @@ Rectangle {
property int cellHeight: 30
property int depthPadding: 15
property bool checkable: false
property alias selectionModel: tree_model.selectionModel
property color lineColor: FluTheme.dividerColor
property color borderColor: FluTheme.dark ? Qt.rgba(37/255,37/255,37/255,1) : Qt.rgba(228/255,228/255,228/255,1)
property color selectedBorderColor: FluTheme.primaryColor
@ -710,9 +711,6 @@ Rectangle {
}
}
}
function selectionModel(){
return tree_model.selectionModel
}
function count(){
return tree_model.dataSourceSize
}

View File

@ -12,6 +12,7 @@ Rectangle {
property int cellHeight: 30
property int depthPadding: 15
property bool checkable: false
property alias selectionModel: tree_model.selectionModel
property color lineColor: FluTheme.dividerColor
property color borderColor: FluTheme.dark ? Qt.rgba(37/255,37/255,37/255,1) : Qt.rgba(228/255,228/255,228/255,1)
property color selectedBorderColor: FluTheme.primaryColor
@ -710,9 +711,6 @@ Rectangle {
}
}
}
function selectionModel(){
return tree_model.selectionModel
}
function count(){
return tree_model.dataSourceSize
}