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

Method init

src/backend/worksheet/Line.cpp:55–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void Line::init(const KConfigGroup& group) {
56 Q_D(Line);
57
58 if (d->histogramLineTypeAvailable)
59 d->histogramLineType = (Histogram::LineType)group.readEntry(d->prefix + QStringLiteral("Type"), (int)Histogram::Bars);
60
61 if (d->prefix == QLatin1String("DropLine"))
62 d->dropLineType = (XYCurve::DropLineType)group.readEntry(d->prefix + QStringLiteral("Type"), (int)XYCurve::DropLineType::NoDropLine);
63
64 d->style = static_cast<Qt::PenStyle>(group.readEntry(d->prefix + QStringLiteral("Style"), (int)Qt::SolidLine));
65 d->width = group.readEntry(d->prefix + QStringLiteral("Width"), Worksheet::convertToSceneUnits(1.0, Worksheet::Unit::Point));
66 d->color = group.readEntry(d->prefix + QStringLiteral("Color"), QColor(Qt::black));
67 d->pen.setStyle(d->style);
68 d->pen.setColor(d->color);
69 d->pen.setWidthF(d->width);
70 d->pen.setCapStyle(Qt::FlatCap);
71 d->pen.setJoinStyle(Qt::MiterJoin);
72 d->opacity = group.readEntry(d->prefix + QStringLiteral("Opacity"), 1.0);
73}
74
75// ##############################################################################
76// ########################## getter methods ##################################

Callers

nothing calls this directly

Calls 3

QColorClass · 0.50
setStyleMethod · 0.45
setColorMethod · 0.45

Tested by

no test coverage detected