mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-30 15:06:52 +08:00
Make the FluTableView readonly text copiable.
This commit is contained in:
parent
2147965b00
commit
e54c161aa6
@ -51,7 +51,8 @@ Rectangle {
|
|||||||
selectAll()
|
selectAll()
|
||||||
}
|
}
|
||||||
onCommit: {
|
onCommit: {
|
||||||
display = text
|
if(!columnSource[column].readOnly)
|
||||||
|
display = text
|
||||||
tableView.closeEditor()
|
tableView.closeEditor()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -110,7 +111,6 @@ Rectangle {
|
|||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
required property bool selected
|
required property bool selected
|
||||||
property bool current: selection_model.currentIndex === table_model.index(row,column)
|
property bool current: selection_model.currentIndex === table_model.index(row,column)
|
||||||
property var readOnly: columnSource[column].readOnly
|
|
||||||
color: selected ? FluTheme.primaryColor.lightest: (row%2!==0) ? control.color : (FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06))
|
color: selected ? FluTheme.primaryColor.lightest: (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
|
||||||
@ -118,9 +118,6 @@ Rectangle {
|
|||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
onDoubleTapped: {
|
onDoubleTapped: {
|
||||||
selection_model.setCurrentIndex(table_model.index(row,column), ItemSelectionModel.Current)
|
selection_model.setCurrentIndex(table_model.index(row,column), ItemSelectionModel.Current)
|
||||||
if(readOnly){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
item_loader.sourceComponent = obtEditDelegate(column,row)
|
item_loader.sourceComponent = obtEditDelegate(column,row)
|
||||||
var index = table_model.index(row,column)
|
var index = table_model.index(row,column)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user