我的ui中有一个QCustomPlot
小部件,如下所示:
ui->plot_widget
我的cpp文件中还有另一个QCustomPlot
对象,如下所示:
QCustomPlot *plot=new QCustomPlot();
我想将plot
数据添加到ui->plot_widget
数据中。
如果我使用ui->plot_widget=plot
,ui->plot_widget
的小部件父级将被销毁,而我的ui不会更新ui->plot_widget
。
如何将plot
数据添加到ui->plot_widget
数据中?