This commit is contained in:
朱子楚\zhuzi 2023-06-27 21:02:57 +08:00
parent 16e71f01b1
commit 1566e3934e
2 changed files with 9 additions and 3 deletions

View File

@ -45,14 +45,16 @@ Rectangle {
FluTextBox {
anchors.fill: parent
text: display
readOnly: true === columnSource[column].readOnly
verticalAlignment: TextInput.AlignVCenter
Component.onCompleted: {
forceActiveFocus()
selectAll()
}
onCommit: {
if(!columnSource[column].readOnly)
if(!readOnly){
display = text
}
tableView.closeEditor()
}
}
@ -358,7 +360,7 @@ Rectangle {
}
function resetPosition(){
table_view.positionViewAtCell(Qt.point(0, 0),Qt.AlignTop|Qt.AlignLeft)
table_view.positionViewAtCell(Qt.point(0, 0),Qt.AlignTop|Qt.AlignLeft)
}
}

View File

@ -62,7 +62,11 @@ TextField{
width: 20
height: 20
opacity: 0.5
visible: control.text !== ""
visible: {
if(control.readOnly)
return false
return control.text !== ""
}
anchors{
verticalCenter: parent.verticalCenter
right: parent.right