16 #include "qcustomplot.h"
66 auto on_customplot_destroy = [
this]() {
p_impl->custom_plot =
nullptr; };
67 *
p_impl->conn_to_customplot =
68 QObject::connect(custom_plot, &QCustomPlot::destroyed, on_customplot_destroy);
74 QObject::disconnect(*
p_impl->conn_to_customplot);
79 return p_impl->toSceneX(customplot_x);
84 return p_impl->toSceneY(customplot_y);
89 return p_impl->fromSceneX(scene_x);
94 return p_impl->fromSceneY(scene_y);
99 return p_impl->viewportRectangle();
~CustomPlotSceneAdapter() override
double toSceneY(double customplot_y) const override
convert local y-coordinate to scene coordinate
double toSceneX(double customplot_x) const override
convert local x-coordinate to scene coordinate
double fromSceneY(double scene_y) const override
convert scene y-coordinate to local axis coordinate
std::unique_ptr< CustomPlotSceneAdapterImpl > p_impl
QRectF viewportRectangle() const override
returns viewport rectangle in scene coordinates
CustomPlotSceneAdapter(QCustomPlot *custom_plot)
double fromSceneX(double scene_x) const override
convert scene x-coordinate to local axis coordinate
materialitems.h Collection of materials to populate MaterialModel.
CustomPlotSceneAdapterImpl(QCustomPlot *custom_plot)
QRectF viewportRectangle() const
double toSceneX(double customplot_x) const
QCustomPlot * custom_plot
std::unique_ptr< QMetaObject::Connection > conn_to_customplot
double fromSceneY(double scene_y) const
double fromSceneX(double scene_x) const
double toSceneY(double customplot_y) const