From e54c161aa6e30edddca94d08e473f28785fd910d Mon Sep 17 00:00:00 2001 From: Mentalflow <312902918@qq.com> Date: Tue, 27 Jun 2023 20:37:05 +0800 Subject: [PATCH] Make the FluTableView readonly text copiable. --- src/imports/FluentUI/Controls/FluTableView.qml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/imports/FluentUI/Controls/FluTableView.qml b/src/imports/FluentUI/Controls/FluTableView.qml index 8a840533..25ccc105 100644 --- a/src/imports/FluentUI/Controls/FluTableView.qml +++ b/src/imports/FluentUI/Controls/FluTableView.qml @@ -51,7 +51,8 @@ Rectangle { selectAll() } onCommit: { - display = text + if(!columnSource[column].readOnly) + display = text tableView.closeEditor() } } @@ -110,7 +111,6 @@ Rectangle { delegate: Rectangle { required property bool selected 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)) implicitHeight: 40 implicitWidth: columnSource[column].width @@ -118,9 +118,6 @@ Rectangle { acceptedButtons: Qt.LeftButton onDoubleTapped: { selection_model.setCurrentIndex(table_model.index(row,column), ItemSelectionModel.Current) - if(readOnly){ - return - } item_loader.sourceComponent = obtEditDelegate(column,row) var index = table_model.index(row,column) }