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

Method handleAspectAdded

src/backend/datapicker/Datapicker.cpp:273–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271}
272
273void Datapicker::handleAspectAdded(const AbstractAspect* aspect) {
274 const auto* addedPoint = qobject_cast<const DatapickerPoint*>(aspect);
275 const auto* curve = qobject_cast<const DatapickerCurve*>(aspect);
276 if (addedPoint)
277 handleChildAspectAdded(addedPoint);
278 else if (curve) {
279 const auto count = childCount<DatapickerCurve>(AbstractAspect::ChildIndexFlag::IncludeHidden);
280 curve->symbol()->setColor(themeColorPalette(count - 1));
281 connect(m_image, &DatapickerImage::axisPointsChanged, curve, &DatapickerCurve::updatePoints);
282 connect(m_image, &DatapickerImage::axisPointsRemoved, curve, &DatapickerCurve::updatePoints);
283 auto points = curve->children<DatapickerPoint>(ChildIndexFlag::IncludeHidden);
284 for (auto* point : points)
285 handleChildAspectAdded(point);
286 } else
287 return;
288
289 qreal zVal = 0;
290 const auto& points = m_image->children<DatapickerPoint>(ChildIndexFlag::IncludeHidden);
291 for (auto* point : points)
292 point->graphicsItem()->setZValue(zVal++);
293
294 for (const auto* curve : children<DatapickerCurve>()) {
295 for (auto* point : curve->children<DatapickerPoint>(ChildIndexFlag::IncludeHidden))
296 point->graphicsItem()->setZValue(zVal++);
297 }
298
299 Q_EMIT requestUpdateActions();
300}
301
302void Datapicker::handleChildAspectAboutToBeRemoved(const AbstractAspect* aspect) {
303 const auto* removedPoint = qobject_cast<const DatapickerPoint*>(aspect);

Callers

nothing calls this directly

Calls 4

setColorMethod · 0.45
symbolMethod · 0.45
setZValueMethod · 0.45
graphicsItemMethod · 0.45

Tested by

no test coverage detected