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

Method init

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

Source from the content-addressed store, hash-verified

48PlotArea::~PlotArea() = default;
49
50void PlotArea::init() {
51 Q_D(PlotArea);
52
53 setHidden(true); // we don't show PlotArea aspect in the model view.
54 d->rect = QRectF(0, 0, 1, 1);
55 d->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
56
57 KConfig config;
58 KConfigGroup group = config.group(QStringLiteral("PlotArea"));
59
60 // Background
61 d->background = new Background(QStringLiteral("background"));
62 addChild(d->background);
63 d->background->setHidden(true);
64 d->background->init(group);
65 connect(d->background, &Background::updateRequested, [=] {
66 d->update();
67 });
68
69 // Border
70 PlotArea::BorderType type; // default value
71 d->borderType = static_cast<PlotArea::BorderType>(group.readEntry(QStringLiteral("BorderType"), static_cast<int>(type)));
72
73 d->borderLine = new Line(QStringLiteral("borderLine"));
74 d->borderLine->setPrefix(QStringLiteral("Border"));
75 d->borderLine->setCreateXmlElement(false);
76 d->borderLine->setHidden(true);
77 addChild(d->borderLine);
78 d->borderLine->init(group);
79 connect(d->borderLine, &Line::updatePixmapRequested, [=] {
80 d->update();
81 });
82 connect(d->borderLine, &Line::updateRequested, [=] {
83 d->recalcShapeAndBoundingRect();
84 Q_EMIT changed();
85 });
86
87 d->borderCornerRadius = group.readEntry(QStringLiteral("BorderCornerRadius"), 0.0);
88}
89
90QGraphicsItem* PlotArea::graphicsItem() const {
91 return d_ptr;

Callers

nothing calls this directly

Calls 7

QRectFClass · 0.85
setCreateXmlElementMethod · 0.80
groupMethod · 0.45
setHiddenMethod · 0.45
updateMethod · 0.45
setPrefixMethod · 0.45

Tested by

no test coverage detected