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

Method init

src/backend/worksheet/plots/cartesian/Histogram.cpp:60–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58Histogram::~Histogram() = default;
59
60void Histogram::init(bool loading) {
61 Q_D(Histogram);
62
63 // line
64 d->line = new Line(QStringLiteral("line"));
65 d->line->setHistogramLineTypeAvailable(true);
66 d->line->setHidden(true);
67 addChild(d->line);
68 connect(d->line, &Line::histogramLineTypeChanged, [=] {
69 d->updateLines();
70 });
71 connect(d->line, &Line::updatePixmapRequested, [=] {
72 d->updatePixmap();
73 });
74 connect(d->line, &Line::updateRequested, [=] {
75 d->recalcShapeAndBoundingRect();
76 });
77
78 // symbol
79 d->symbol = new Symbol(QStringLiteral("symbol"));
80 addChild(d->symbol);
81 d->symbol->setHidden(true);
82 connect(d->symbol, &Symbol::updateRequested, [=] {
83 d->updateSymbols();
84 });
85 connect(d->symbol, &Symbol::updatePixmapRequested, [=] {
86 d->updatePixmap();
87 });
88
89 // values
90 d->value = new Value(QString());
91 addChild(d->value);
92 d->value->setHidden(true);
93 d->value->setcenterPositionAvailable(true);
94 connect(d->value, &Value::updatePixmapRequested, [=] {
95 d->updatePixmap();
96 });
97 connect(d->value, &Value::updateRequested, [=] {
98 d->updateValues();
99 });
100
101 // Background/Filling
102 d->background = new Background(QStringLiteral("background"));
103 d->background->setPrefix(QStringLiteral("Filling"));
104 d->background->setEnabledAvailable(true);
105 addChild(d->background);
106 d->background->setHidden(true);
107 connect(d->background, &Background::updateRequested, [=] {
108 d->updatePixmap();
109 });
110 connect(d->background, &Background::updatePositionRequested, [=] {
111 d->updateFilling();
112 });
113
114 // error bars
115 d->errorBar = new ErrorBar(QStringLiteral("errorBar"), ErrorBar::Dimension::Y);
116 addChild(d->errorBar);
117 d->errorBar->setHidden(true);

Callers

nothing calls this directly

Calls 14

setEnabledAvailableMethod · 0.80
QStringClass · 0.50
setHiddenMethod · 0.45
updateLinesMethod · 0.45
updatePixmapMethod · 0.45
updateSymbolsMethod · 0.45
updateValuesMethod · 0.45
setPrefixMethod · 0.45
updateFillingMethod · 0.45

Tested by

no test coverage detected