From 8dff4671ae719cd100ccf7da74df0a2bf0e34d2f Mon Sep 17 00:00:00 2001 From: Igor Malinovskiy Date: Thu, 19 Nov 2020 16:21:10 +0200 Subject: [PATCH] Fix #4919 --- src/qml/LogView.qml | 8 ++++++++ src/qml/common/FastTextView.qml | 22 ++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/qml/LogView.qml b/src/qml/LogView.qml index 5d11b28e7..759ddf791 100644 --- a/src/qml/LogView.qml +++ b/src/qml/LogView.qml @@ -10,6 +10,14 @@ FastTextView { model: ListModel {} + function dumpText() { + var allStrings = ""; + for (var ind=0; ind < root.model.count; ind++) { + allStrings += root.model.get(ind)["msg"] + "\n" + } + return allStrings + } + color: sysPalette.base border.color: sysPalette.shadow border.width: 1 diff --git a/src/qml/common/FastTextView.qml b/src/qml/common/FastTextView.qml index 0545f8a9d..bf6102d0a 100644 --- a/src/qml/common/FastTextView.qml +++ b/src/qml/common/FastTextView.qml @@ -12,6 +12,14 @@ Rectangle { listView.positionViewAtEnd() } + function dumpText() { + var allStrings = ""; + for (var id in root.model) { + allStrings += root.model[id] + "\n" + } + return allStrings + } + ScrollView { anchors.fill: parent anchors.margins: 10 @@ -22,8 +30,11 @@ Rectangle { id: listView width: root.width - 20 - delegate: BetterLabel { + delegate: TextEdit { + color: sysPalette.text width: listView.width + readOnly: true + selectByMouse: true text: { if (root.showLineNumbers) { return (index+1) + ". " + modelData @@ -56,13 +67,8 @@ Rectangle { icon.source: "qrc:/images/copy.svg" icon.color: "transparent" - onTriggered: { - var allStrings = ""; - for (var id in affectedKeysListView.model) { - allStrings += affectedKeysListView.model[id] + "\n" - } - qmlUtils.copyToClipboard(allStrings) - allStrings = "" + onTriggered: { + qmlUtils.copyToClipboard(root.dumpText()) } } }