mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
Feat: add copy value only option on logger and tracker
This commit is contained in:
@@ -342,6 +342,7 @@ void SeerVariableLoggerBrowserWidget::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;
|
||||
@@ -399,12 +400,12 @@ void SeerVariableLoggerBrowserWidget::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 || action == copyValueOnlyAction) {
|
||||
items = variablesTreeWidget->selectedItems();
|
||||
}
|
||||
|
||||
@@ -427,8 +428,12 @@ void SeerVariableLoggerBrowserWidget::handleContextMenu (const QPoint& pos) {
|
||||
if (i != 0) {
|
||||
text += '\n';
|
||||
}
|
||||
if (action != copyValueOnlyAction) {
|
||||
text += items[i]->text(1) + ":" + items[i]->text(2);
|
||||
} else {
|
||||
text += items[i]->text(2);
|
||||
}
|
||||
|
||||
text += items[i]->text(1) + ":" + items[i]->text(2);
|
||||
}
|
||||
|
||||
clipboard->setText(text, QClipboard::Clipboard);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user