补充提交

This commit is contained in:
2026-07-30 08:07:43 +08:00
parent e7a62b3c02
commit ceb29b1ce2
12 changed files with 800 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
#pragma once
#include "../../Renderive/base/Tool.h"
static QWidget* create_frequent_axis_test_plot() {
class Axis_Test_Plot : public YSG::Plot {
public:
std::shared_ptr<YSG::Frequency_Axis> axis{};
QMenu* menu{};
void init() override {
Plot::init();
object_name = "Axis_Test_Plot";
auto axis_node = create_renderable_node(root_renderable(), "Axis_Renderable");
axis = YSG::Frequency_Axis::Builder(axis_node, Qt::Horizontal)
.set_tick_length(-10)
.set_sub_tick_length(-5)
.build();
}
protected:
void resizeEvent(QResizeEvent* event) override {
int space = 50;
axis->set_x(space);
axis->set_y(height() / 2);
axis->set_pixel_size(width() - space * 2);
}
void contextMenuEvent(QContextMenuEvent* event) override {
if (!menu) {
auto ws = bw(cw(axis.get()), "");
menu = create_menu(this, ws);
}
menu->exec(event->globalPos());
}
};
auto w = new Axis_Test_Plot;
w->init();
return w;
}