forked from qt-creator/qt-creator
Debugger: Fix copy to clipboard...
...for Locals & Expressions. Task-number: QTCREATORBUG-15870 Change-Id: I5768908ab731adffd695627206fd03cc5ccce957 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -889,17 +889,8 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
|
|||||||
} else if (act == &actRemoveAllWatchExpression) {
|
} else if (act == &actRemoveAllWatchExpression) {
|
||||||
handler->clearWatches();
|
handler->clearWatches();
|
||||||
} else if (act == &actCopy) {
|
} else if (act == &actCopy) {
|
||||||
QString text;
|
QString contents = handler->editorContents();
|
||||||
QTextStream str(&text);
|
copyToClipboard(contents);
|
||||||
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);
|
|
||||||
} else if (act == &actCopyValue) {
|
} else if (act == &actCopyValue) {
|
||||||
copyToClipboard(mi1.data().toString());
|
copyToClipboard(mi1.data().toString());
|
||||||
} else if (act == &actShowInEditor) {
|
} else if (act == &actShowInEditor) {
|
||||||
|
|||||||
Reference in New Issue
Block a user