| 1353 | } |
| 1354 | |
| 1355 | void 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 ################################## |
nothing calls this directly
no test coverage detected