performance 复制按钮

This commit is contained in:
2026-08-03 09:30:03 +08:00
parent 43bbe54b72
commit b2eb81448b
7 changed files with 136 additions and 8 deletions
+6
View File
@@ -7,6 +7,8 @@
#include "Core/plottable/export.h"
#include "Core/plot/Plot_Core_Access.h"
#include "Core/architecture/Plot_Render_Context.h"
#include <QClipboard>
#include <QGuiApplication>
#include <QPainter>
#include <QPointer>
#include <QResizeEvent>
@@ -60,6 +62,9 @@ void Abs_Plot_Private::attach_widget(Abs_Plot* plot) {
guarded_plot->update();
});
});
set_performance_overlay_clipboard_callback(*core, [](std::string text) {
QGuiApplication::clipboard()->setText(QString::fromUtf8(text.data(), static_cast<int>(text.size())));
});
}
Abs_Plot::Abs_Plot(Abs_Plot_Private* private_data)
@@ -73,6 +78,7 @@ Abs_Plot::Abs_Plot(Abs_Plot_Private* private_data)
Abs_Plot::~Abs_Plot() {
if (d) {
set_performance_overlay_update_callback(*d->core, {});
set_performance_overlay_clipboard_callback(*d->core, {});
d->core->deactivate_view();
delete d;
d = nullptr;