MCPcopy Create free account
hub / github.com/KDE/labplot / removeCurve

Method removeCurve

src/backend/worksheet/InfoElement.cpp:389–415  ·  view source on GitHub ↗

! * Remove markerpoint from a curve * @param curve */

Source from the content-addressed store, hash-verified

387 * @param curve
388 */
389void InfoElement::removeCurve(const XYCurve* curve) {
390 for (const auto& mp : markerpoints) {
391 if (mp.curve == curve) {
392 disconnect(curve, nullptr, this, nullptr);
393 setUndoAware(false);
394 removeChild(mp.customPoint);
395 setUndoAware(true);
396 }
397 }
398
399 setUndoAware(false);
400 if (curve->name() == connectionLineCurveName())
401 setConnectionLineNextValidCurve();
402 setUndoAware(true);
403
404 m_title->setUndoAware(false);
405 m_title->setText(createTextLabelText());
406
407 // hide the label if now curves are selected
408 if (markerpoints.isEmpty()) {
409 m_title->setVisible(false); // hide in the worksheet view
410 Q_D(InfoElement);
411 d->update(); // redraw to remove all children graphic items belonging to InfoElement
412 }
413
414 m_title->setUndoAware(true);
415}
416
417/*!
418 * Set the z value of the m_title and the custompoints higher than the infoelement

Callers 1

curveSelectionChangedMethod · 0.45

Calls 6

setUndoAwareMethod · 0.80
nameMethod · 0.45
setTextMethod · 0.45
isEmptyMethod · 0.45
setVisibleMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected