forked from qt-creator/qt-creator
Debugger: Add a way to copy selected values from Locals and Expressions
Task-number: QTCREATORBUG-14956 Change-Id: I2700820adf716afb784ec686297c15c48f3592f7 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -811,8 +811,10 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
|
||||
|| actSetWatchpointAtExpression.isEnabled());
|
||||
|
||||
QAction actCopy(tr("Copy View Contents to Clipboard"), 0);
|
||||
QAction actCopyValue(tr("Copy Value to Clipboard"), 0);
|
||||
QAction actCopyValue(tr("Copy Current Value to Clipboard"), 0);
|
||||
actCopyValue.setEnabled(idx.isValid());
|
||||
QAction actCopySelected(tr("Copy Selected Rows to Clipboard"), 0);
|
||||
actCopySelected.setEnabled(selectionModel()->hasSelection());
|
||||
|
||||
QAction actShowInEditor(tr("Open View Contents in Editor"), 0);
|
||||
actShowInEditor.setEnabled(actionsEnabled);
|
||||
@@ -835,6 +837,7 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
|
||||
menu.addAction(&actCloseEditorToolTips);
|
||||
menu.addAction(&actCopy);
|
||||
menu.addAction(&actCopyValue);
|
||||
menu.addAction(&actCopySelected);
|
||||
menu.addAction(&actShowInEditor);
|
||||
menu.addSeparator();
|
||||
|
||||
@@ -891,6 +894,9 @@ void WatchTreeView::contextMenuEvent(QContextMenuEvent *ev)
|
||||
} else if (act == &actCopy) {
|
||||
QString contents = handler->editorContents();
|
||||
copyToClipboard(contents);
|
||||
} else if (act == &actCopySelected) {
|
||||
QString contents = handler->editorContents(selectionModel()->selectedRows());
|
||||
copyToClipboard(contents);
|
||||
} else if (act == &actCopyValue) {
|
||||
copyToClipboard(mi1.data().toString());
|
||||
} else if (act == &actShowInEditor) {
|
||||
|
||||
Reference in New Issue
Block a user