MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / addToLegend

Method addToLegend

3rdparty/qcustomplot/qcustomplot.cpp:11810–11829  ·  view source on GitHub ↗

! \overload Adds this plottable to the specified \a legend. Creates a QCPPlottableLegendItem which is inserted into the legend. Returns true on success, i.e. when the legend exists and a legend item associated with this plottable isn't already in the legend. If the plottable needs a more specialized representation in the legend, you can create a corresponding subclass of \ref QCPPlo

Source from the content-addressed store, hash-verified

11808 \see removeFromLegend, QCPLegend::addItem
11809*/
11810bool QCPAbstractPlottable::addToLegend(QCPLegend *legend)
11811{
11812 if (!legend)
11813 {
11814 qDebug() << Q_FUNC_INFO << "passed legend is null";
11815 return false;
11816 }
11817 if (legend->parentPlot() != mParentPlot)
11818 {
11819 qDebug() << Q_FUNC_INFO << "passed legend isn't in the same QCustomPlot as this plottable";
11820 return false;
11821 }
11822
11823 if (!legend->hasItemWithPlottable(this))
11824 {
11825 legend->addItem(new QCPPlottableLegendItem(legend, this));
11826 return true;
11827 } else
11828 return false;
11829}
11830
11831/*! \overload
11832

Callers 3

registerPlottableMethod · 0.80
registerPolarGraphMethod · 0.80
importCsvMethod · 0.80

Calls 2

hasItemWithPlottableMethod · 0.80
addItemMethod · 0.80

Tested by

no test coverage detected