Feat: add copy value only option on logger and tracker

This commit is contained in:
Levent Kaya
2026-03-23 11:29:46 +03:00
parent e9a73fa310
commit fa35f30dfa
2 changed files with 16 additions and 6 deletions
+8 -3
View File
@@ -590,6 +590,7 @@ void SeerVariableTrackerBrowserWidget::handleContextMenu (const QPoint& pos) {
QAction* deleteAllAction = menu.addAction("Delete all");
QAction* copyAction = menu.addAction("Copy selected");
QAction* copyValueOnlyAction = menu.addAction("Copy selected value");
QAction* copyAllAction = menu.addAction("Copy all");
QString actionText;
@@ -646,12 +647,12 @@ void SeerVariableTrackerBrowserWidget::handleContextMenu (const QPoint& pos) {
handleDeleteAllToolButton();
}
if (action == copyAction || action == copyAllAction) {
if (action == copyAction || action == copyAllAction || action == copyValueOnlyAction) {
// Get selected tree items.
QList<QTreeWidgetItem*> items;
// Get list of 'select' items.
if (action == copyAction) {
if (action == copyAction || copyValueOnlyAction) {
items = variablesTreeWidget->selectedItems();
}
@@ -675,7 +676,11 @@ void SeerVariableTrackerBrowserWidget::handleContextMenu (const QPoint& pos) {
text += '\n';
}
text += items[i]->text(0) + ":" + items[i]->text(1);
if (action != copyValueOnlyAction) {
text += items[i]->text(0) + ":" + items[i]->text(1);
} else {
text += items[i]->text(1);
}
}
clipboard->setText(text, QClipboard::Clipboard);