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

Method loadPoints

src/backend/worksheet/InfoElement.cpp:1355–1386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1353}
1354
1355void InfoElement::loadPoints(XmlStreamReader* reader, bool preview) {
1356 reader->readNextStartElement();
1357 if (!reader->isStartElement())
1358 return;
1359
1360 while (!(reader->isEndElement() && reader->name() == QStringLiteral("points"))) {
1361 Q_D(const InfoElement);
1362 if (!reader->isStartElement()) {
1363 reader->readNext();
1364 continue;
1365 }
1366 if (reader->name() != QLatin1String("point"))
1367 break;
1368 const auto& attribs = reader->attributes();
1369 const QString curvePath = attribs.value(QStringLiteral("curvepath")).toString();
1370 const bool visible = attribs.value(QStringLiteral("visible")).toInt();
1371
1372 reader->readNextStartElement();
1373 if (reader->name() != CustomPoint::xmlName())
1374 break;
1375
1376 auto* point = new CustomPoint(d->m_plot, QString());
1377 point->setIsLoading(true);
1378 if (!point->load(reader, preview)) {
1379 delete point;
1380 return;
1381 }
1382 point->setVisible(visible);
1383 this->addChild(point);
1384 addCurvePath(curvePath, point);
1385 }
1386}
1387
1388// ##############################################################################
1389// ######################### Theme management ##################################

Callers

nothing calls this directly

Calls 8

setIsLoadingMethod · 0.80
QStringClass · 0.50
nameMethod · 0.45
toStringMethod · 0.45
valueMethod · 0.45
loadMethod · 0.45
setVisibleMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected