| 254 | } |
| 255 | |
| 256 | void PlotWidgetBase::removeCurve(const QString& title) { |
| 257 | auto it = std::find_if(plot_->curve_list.begin(), plot_->curve_list.end(), [&title](const CurveInfo& info) { |
| 258 | return info.curve != nullptr && (info.curve->title().text() == title || info.source_name == title); |
| 259 | }); |
| 260 | if (it == plot_->curve_list.end()) { |
| 261 | return; |
| 262 | } |
| 263 | |
| 264 | it->curve->detach(); |
| 265 | delete it->curve; |
| 266 | it->marker->detach(); |
| 267 | delete it->marker; |
| 268 | plot_->curve_list.erase(it); |
| 269 | emit curveListChanged(); |
| 270 | } |
| 271 | |
| 272 | const std::list<PlotWidgetBase::CurveInfo>& PlotWidgetBase::curveList() const noexcept { |
| 273 | return plot_->curve_list; |