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

Method insertChildBeforeFast

src/backend/core/AbstractAspect.cpp:575–587  ·  view source on GitHub ↗

* \brief Insert the given Aspect at a specific position in my list of children.without any checks and without putting this step onto the undo-stack */

Source from the content-addressed store, hash-verified

573 * \brief Insert the given Aspect at a specific position in my list of children.without any checks and without putting this step onto the undo-stack
574 */
575void AbstractAspect::insertChildBeforeFast(AbstractAspect* child, AbstractAspect* before) {
576 connect(child, &AbstractAspect::selected, this, &AbstractAspect::childSelected);
577 connect(child, &AbstractAspect::deselected, this, &AbstractAspect::childDeselected);
578
579 int index = d->indexOfChild(before);
580 if (index == -1)
581 index = d->m_children.count();
582
583 Q_EMIT childAspectAboutToBeAdded(this, nullptr, child);
584 d->insertChild(index, child);
585 child->finalizeAdd();
586 Q_EMIT childAspectAdded(child);
587}
588
589/**
590 * \brief Remove the given Aspect from my list of children.

Callers

nothing calls this directly

Calls 4

insertChildMethod · 0.80
indexOfChildMethod · 0.45
countMethod · 0.45
finalizeAddMethod · 0.45

Tested by

no test coverage detected