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

Method deleteAspectFromGraphicsItem

src/backend/worksheet/Worksheet.cpp:510–527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508}
509
510void Worksheet::deleteAspectFromGraphicsItem(const QGraphicsItem* item) {
511 Q_ASSERT(item);
512 // determine the corresponding aspect
513 AbstractAspect* aspect(nullptr);
514 for (const auto* child : children<WorksheetElement>(ChildIndexFlag::IncludeHidden)) {
515 aspect = this->aspectFromGraphicsItem(child, item);
516 if (aspect)
517 break;
518 }
519
520 if (!aspect)
521 return;
522
523 if (aspect->parentAspect())
524 aspect->parentAspect()->removeChild(aspect);
525 else
526 this->removeChild(aspect);
527}
528
529void Worksheet::setIsClosing() {
530 if (m_view)

Callers 1

deleteElementMethod · 0.80

Calls 3

parentAspectMethod · 0.80
removeChildMethod · 0.45

Tested by

no test coverage detected