This commit is contained in:
zhuzichu 2023-06-30 17:39:58 +08:00
parent c42f3ef70f
commit bbb6fe9329

View File

@ -190,9 +190,9 @@ Rectangle {
id:item_table id:item_table
property var position: Qt.point(column,row) property var position: Qt.point(column,row)
required property bool selected required property bool selected
onSelectedChanged: { // onSelectedChanged: {
d.selectionFlag = !d.selectionFlag // d.selectionFlag = !d.selectionFlag
} // }
color: (row%2!==0) ? control.color : (FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06)) color: (row%2!==0) ? control.color : (FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06))
implicitHeight: 40 implicitHeight: 40
implicitWidth: columnSource[column].width implicitWidth: columnSource[column].width
@ -224,6 +224,7 @@ Rectangle {
selection_model.clear() selection_model.clear()
} }
selection_model.select(table_model.index(row,column),ItemSelectionModel.Select) selection_model.select(table_model.index(row,column),ItemSelectionModel.Select)
d.selectionFlag = !d.selectionFlag
event.accepted = true event.accepted = true
} }
} }
@ -262,6 +263,12 @@ Rectangle {
Component{ Component{
id:com_handle id:com_handle
Item { Item {
onYChanged: {
d.selectionFlag = !d.selectionFlag
}
onXChanged: {
d.selectionFlag = !d.selectionFlag
}
} }
} }
SelectionRectangle { SelectionRectangle {
@ -331,11 +338,12 @@ Rectangle {
for(var i=0;i<=table_view.rows;i++){ for(var i=0;i<=table_view.rows;i++){
selection_model.select(table_model.index(i,column),ItemSelectionModel.Select) selection_model.select(table_model.index(i,column),ItemSelectionModel.Select)
} }
d.selectionFlag = !d.selectionFlag
} }
MouseArea{ MouseArea{
property point clickPos: "0,0" property point clickPos: "0,0"
height: parent.height height: parent.height
width: 4 width: 6
anchors.right: parent.right anchors.right: parent.right
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
visible: !(obj.width === obj.minimumWidth && obj.width === obj.maximumWidth) visible: !(obj.width === obj.minimumWidth && obj.width === obj.maximumWidth)
@ -419,10 +427,11 @@ Rectangle {
for(var i=0;i<=columnSource.length;i++){ for(var i=0;i<=columnSource.length;i++){
selection_model.select(table_model.index(row,i),ItemSelectionModel.Select) selection_model.select(table_model.index(row,i),ItemSelectionModel.Select)
} }
d.selectionFlag = !d.selectionFlag
} }
MouseArea{ MouseArea{
property point clickPos: "0,0" property point clickPos: "0,0"
height: 4 height: 6
width: parent.width width: parent.width
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton