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

Method load

src/backend/worksheet/plots/PlotArea.cpp:290–331  ·  view source on GitHub ↗

Load from XML

Source from the content-addressed store, hash-verified

288
289//! Load from XML
290bool PlotArea::load(XmlStreamReader* reader, bool preview) {
291 Q_D(PlotArea);
292
293 if (!readBasicAttributes(reader))
294 return false;
295
296 QXmlStreamAttributes attribs;
297 QString str;
298
299 while (!reader->atEnd()) {
300 reader->readNext();
301 if (reader->isEndElement() && reader->name() == QLatin1String("plotArea"))
302 break;
303
304 if (!reader->isStartElement())
305 continue;
306
307 if (!preview && reader->name() == QLatin1String("comment")) {
308 if (!readCommentElement(reader))
309 return false;
310 } else if (!preview && reader->name() == QLatin1String("background"))
311 d->background->load(reader, preview);
312 else if (!preview && reader->name() == QLatin1String("border")) {
313 attribs = reader->attributes();
314
315 READ_INT_VALUE("borderType", borderType, PlotArea::BorderType);
316 d->borderLine->load(reader, preview);
317
318 str = attribs.value(QStringLiteral("borderCornerRadius")).toString();
319 if (str.isEmpty())
320 reader->raiseMissingAttributeWarning(QStringLiteral("borderCornerRadius"));
321 else
322 d->borderCornerRadius = str.toDouble();
323 } else { // unknown element
324 reader->raiseUnknownElementWarning();
325 if (!reader->skipToEndElement())
326 return false;
327 }
328 }
329
330 return true;
331}
332
333void PlotArea::loadThemeConfig(const KConfig& config) {
334 KConfigGroup group;

Callers

nothing calls this directly

Calls 8

atEndMethod · 0.80
skipToEndElementMethod · 0.80
nameMethod · 0.45
toStringMethod · 0.45
valueMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected