! \overload Removes the plottable from the specifed \a legend. This means the \ref QCPPlottableLegendItem that is associated with this plottable is removed. Returns true on success, i.e. if the legend exists and a legend item associated with this plottable was found and removed. \see addToLegend, QCPLegend::removeItem */
| 11853 | \see addToLegend, QCPLegend::removeItem |
| 11854 | */ |
| 11855 | bool QCPAbstractPlottable::removeFromLegend(QCPLegend *legend) const |
| 11856 | { |
| 11857 | if (!legend) |
| 11858 | { |
| 11859 | qDebug() << Q_FUNC_INFO << "passed legend is null"; |
| 11860 | return false; |
| 11861 | } |
| 11862 | |
| 11863 | if (QCPPlottableLegendItem *lip = legend->itemWithPlottable(this)) |
| 11864 | return legend->removeItem(lip); |
| 11865 | else |
| 11866 | return false; |
| 11867 | } |
| 11868 | |
| 11869 | /*! \overload |
| 11870 |
no test coverage detected