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

Method load

src/backend/datapicker/DatapickerCurve.cpp:592–774  ·  view source on GitHub ↗

Load from XML

Source from the content-addressed store, hash-verified

590
591//! Load from XML
592bool DatapickerCurve::load(XmlStreamReader* reader, bool preview) {
593 Q_D(DatapickerCurve);
594
595 if (!readBasicAttributes(reader))
596 return false;
597
598 QXmlStreamAttributes attribs;
599 QString str;
600
601 while (!reader->atEnd()) {
602 reader->readNext();
603 if (reader->isEndElement() && reader->name() == QLatin1String("datapickerCurve"))
604 break;
605
606 if (!reader->isStartElement())
607 continue;
608
609 if (reader->name() == QLatin1String("comment")) {
610 if (!readCommentElement(reader))
611 return false;
612 } else if (!preview && reader->name() == QLatin1String("general")) {
613 attribs = reader->attributes();
614
615 READ_INT_VALUE("visible", pointVisibility, bool);
616 READ_INT_VALUE("curveErrorType_X", curveErrorTypes.x, ErrorType);
617 READ_INT_VALUE("curveErrorType_Y", curveErrorTypes.y, ErrorType);
618
619 READ_COLUMN_NAME(posXColumn);
620 READ_COLUMN_NAME(posYColumn);
621 READ_COLUMN_NAME(posZColumn);
622 READ_COLUMN_NAME(plusDeltaXColumn);
623 READ_COLUMN_NAME(minusDeltaXColumn);
624 READ_COLUMN_NAME(plusDeltaYColumn);
625 READ_COLUMN_NAME(minusDeltaYColumn);
626 } else if (!preview && reader->name() == QLatin1String("symbolProperties")) {
627 // old serialization that was used before the switch to Symbol::load().
628 // in the old serialization the symbol properties and "point visibility" where saved
629 // under "symbolProperties".
630 attribs = reader->attributes();
631
632 str = attribs.value(QStringLiteral("pointRotationAngle")).toString();
633 if (str.isEmpty())
634 reader->raiseMissingAttributeWarning(QStringLiteral("pointRotationAngle"));
635 else
636 d->symbol->setRotationAngle(str.toDouble());
637
638 str = attribs.value(QStringLiteral("pointOpacity")).toString();
639 if (str.isEmpty())
640 reader->raiseMissingAttributeWarning(QStringLiteral("pointOpacity"));
641 else
642 d->symbol->setOpacity(str.toDouble());
643
644 str = attribs.value(QStringLiteral("pointSize")).toString();
645 if (str.isEmpty())
646 reader->raiseMissingAttributeWarning(QStringLiteral("pointSize"));
647 else
648 d->symbol->setSize(str.toDouble());
649

Callers

nothing calls this directly

Calls 15

atEndMethod · 0.80
setBrushMethod · 0.80
setPenMethod · 0.80
initErrorBarMethod · 0.80
setFixedMethod · 0.80
skipToEndElementMethod · 0.80
QStringClass · 0.50
nameMethod · 0.45
toStringMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected