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

Method save

src/backend/worksheet/plots/cartesian/CartesianPlotLegend.cpp:804–850  ·  view source on GitHub ↗

############################################################################## ################## Serialization/Deserialization ########################### ############################################################################## Save as XML

Source from the content-addressed store, hash-verified

802// ##############################################################################
803//! Save as XML
804void CartesianPlotLegend::save(QXmlStreamWriter* writer) const {
805 Q_D(const CartesianPlotLegend);
806
807 writer->writeStartElement(QStringLiteral("cartesianPlotLegend"));
808 writeBasicAttributes(writer);
809 writeCommentElement(writer);
810
811 // general
812 writer->writeStartElement(QStringLiteral("general"));
813 writer->writeAttribute(QStringLiteral("usePlotColor"), QString::number(d->usePlotColor));
814 WRITE_QCOLOR(d->labelColor);
815 WRITE_QFONT(d->labelFont);
816 writer->writeAttribute(QStringLiteral("columnMajor"), QString::number(d->labelColumnMajor));
817 writer->writeAttribute(QStringLiteral("lineSymbolWidth"), QString::number(d->lineSymbolWidth));
818 writer->writeAttribute(QStringLiteral("visible"), QString::number(d->isVisible()));
819 writer->writeEndElement();
820
821 // geometry
822 writer->writeStartElement(QStringLiteral("geometry"));
823 WorksheetElement::save(writer);
824 writer->writeEndElement();
825
826 // title
827 d->title->save(writer);
828
829 // background
830 d->background->save(writer);
831
832 // border
833 writer->writeStartElement(QStringLiteral("border"));
834 d->borderLine->save(writer);
835 writer->writeAttribute(QStringLiteral("borderCornerRadius"), QString::number(d->borderCornerRadius));
836 writer->writeEndElement();
837
838 // layout
839 writer->writeStartElement(QStringLiteral("layout"));
840 writer->writeAttribute(QStringLiteral("topMargin"), QString::number(d->layoutTopMargin));
841 writer->writeAttribute(QStringLiteral("bottomMargin"), QString::number(d->layoutBottomMargin));
842 writer->writeAttribute(QStringLiteral("leftMargin"), QString::number(d->layoutLeftMargin));
843 writer->writeAttribute(QStringLiteral("rightMargin"), QString::number(d->layoutRightMargin));
844 writer->writeAttribute(QStringLiteral("verticalSpacing"), QString::number(d->layoutVerticalSpacing));
845 writer->writeAttribute(QStringLiteral("horizontalSpacing"), QString::number(d->layoutHorizontalSpacing));
846 writer->writeAttribute(QStringLiteral("columnCount"), QString::number(d->layoutColumnCount));
847 writer->writeEndElement();
848
849 writer->writeEndElement(); // close "cartesianPlotLegend" section
850}
851
852//! Load from XML
853bool CartesianPlotLegend::load(XmlStreamReader* reader, bool preview) {

Callers 2

paintMethod · 0.45
translatePainterMethod · 0.45

Calls 1

isVisibleMethod · 0.45

Tested by

no test coverage detected