From 9f4124df5bdd19c9090ca6a0cb7dc2c60371a900 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 14 Mar 2016 14:42:55 +0100 Subject: [PATCH] Debugger: Fix copy to clipboard... ...for Locals & Expressions. Task-number: QTCREATORBUG-15870 Change-Id: I5768908ab731adffd695627206fd03cc5ccce957 Reviewed-by: hjk --- src/plugins/debugger/watchwindow.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 290213d918a..1574f99113b 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -889,17 +889,8 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev) } else if (act == &actRemoveAllWatchExpression) { handler->clearWatches(); } else if (act == &actCopy) { - QString text; - QTextStream str(&text); - handler->model()->rootItem()->walkTree([&str](Utils::TreeItem *item) { - str << QString(item->level(), QLatin1Char('\t')) - << item->data(0, Qt::DisplayRole).toString() << '\t' - << item->data(1, Qt::DisplayRole).toString() << '\t' - << item->data(2, Qt::DisplayRole).toString() << '\n'; - }); - QClipboard *clipboard = QApplication::clipboard(); - clipboard->setText(text, QClipboard::Selection); - clipboard->setText(text, QClipboard::Clipboard); + QString contents = handler->editorContents(); + copyToClipboard(contents); } else if (act == &actCopyValue) { copyToClipboard(mi1.data().toString()); } else if (act == &actShowInEditor) {