Home > Mobile >  Ask god how to delete QCustomPlot draw the picture
Ask god how to delete QCustomPlot draw the picture

Time:10-05

Is there a delete QCUStOMPlot in function of the current image

CodePudding user response:

There seems to be a a removeGraph method

CodePudding user response:

The UI - & gt; WidgetPlot - & gt; Graph (0) - & gt; ClearData ();
The UI - & gt; WidgetPlot - & gt; Replot ();

CodePudding user response:

detachItems

CodePudding user response:

I also encountered this problem? The building Lord solved excuse me

CodePudding user response:

The UI - & gt; TestPlot - & gt; Graph (0) - & gt; Data (). The data () - & gt; The clear ();
Close test available

CodePudding user response:

QCustomPlot * CustomPlot=UI - & gt; The widget.
CustomPlot - & gt; RemoveGraph (1);
CustomPlot - & gt; Replot ();

1 is the serial number of the picture here, kiss ~ test available

CodePudding user response:

ClearPlottables ();

CodePudding user response:

 
For (int I=mPlot - & gt; PlotLayout () - & gt; ElementCount () - 1; I & gt; 0; I -)
{
MPlot - & gt; PlotLayout () - & gt; The removeAt (I);
}
For (int I=mPlot - & gt; PlottableCount () - 1; I & gt; 0; I -)
{
MPlot - & gt; RemovePlottable (I);
}

CodePudding user response:

A less
 
For (int I=mPlot - & gt; GraphCount () - 1; I & gt;=0; I -)
{
MPlot - & gt; RemoveGraph (I);
}

CodePudding user response:

//from big to small, in order to empty layer
The UI - & gt; CustomPlot - & gt; RemoveGraph (1);
The UI - & gt; CustomPlot - & gt; RemoveGraph (0);

The UI - & gt; CustomPlot - & gt; Replot ();

CodePudding user response:

TestPlot - & gt; Graph (0) - & gt; Data (). The data () - & gt; The clear ();
This can be used more convenient, one line of code is done

CodePudding user response:

QCustomPlot have two clear image function:
QCustomPlot: : clearGraphs ();
QCustomPlot: : clearItems ();
See which one you used to, which is invoked

CodePudding user response:

My reference side of the blog https://blog.csdn.net/toby54king/article/details/79033381 use clearPlottables () to remove the graphics, but could not clear word,
  •  Tags:  
  • Qt
  • Related