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

Method finalizeAdd

src/backend/worksheet/plots/cartesian/ProcessBehaviorChart.cpp:198–244  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void ProcessBehaviorChart::finalizeAdd() {
199 Q_D(ProcessBehaviorChart);
200 WorksheetElement::finalizeAdd();
201
202 // curves
203 addChildFast(d->centerCurve);
204 addChildFast(d->upperLimitCurve);
205 addChildFast(d->lowerLimitCurve);
206 addChildFast(d->dataCurve);
207
208 // labels
209 addChildFast(d->upperLimitLabel);
210 d->upperLimitLabel->setCoordinateBindingEnabled(true);
211 d->upperLimitLabel->setParentGraphicsItem(graphicsItem());
212 d->upperLimitLabel->graphicsItem()->setFlag(QGraphicsItem::ItemIsMovable, false);
213
214 addChildFast(d->centerLabel);
215 d->centerLabel->setCoordinateBindingEnabled(true);
216 d->centerLabel->setParentGraphicsItem(graphicsItem());
217 d->centerLabel->graphicsItem()->setFlag(QGraphicsItem::ItemIsMovable, false);
218
219 addChildFast(d->lowerLimitLabel);
220 d->lowerLimitLabel->setCoordinateBindingEnabled(true);
221 d->lowerLimitLabel->setParentGraphicsItem(graphicsItem());
222 d->lowerLimitLabel->graphicsItem()->setFlag(QGraphicsItem::ItemIsMovable, false);
223
224 // synchronize the names of the internal XYCurves with the name of the current plot
225 // so we have the same name shown on the undo stack
226 connect(this, &AbstractAspect::aspectDescriptionChanged, this, &ProcessBehaviorChart::renameInternalCurves);
227
228 // propagate the visual changes to the parent
229 connect(d->centerCurve, &XYCurve::changed, this, &ProcessBehaviorChart::changed);
230 connect(d->dataCurve, &XYCurve::changed, this, &ProcessBehaviorChart::changed);
231 connect(d->upperLimitCurve, &XYCurve::changed, this, &ProcessBehaviorChart::changed);
232 connect(d->lowerLimitCurve, &XYCurve::changed, this, &ProcessBehaviorChart::changed);
233
234 // re-position the labels on text changes
235 connect(d->upperLimitLabel, &TextLabel::textWrapperChanged, d->upperLimitLabel, &TextLabel::retransform);
236 connect(d->centerLabel, &TextLabel::textWrapperChanged, d->centerLabel, &TextLabel::retransform);
237 connect(d->lowerLimitLabel, &TextLabel::textWrapperChanged, d->lowerLimitLabel, &TextLabel::retransform);
238
239 // notify the dock widget on changes in Line
240 connect(d->labelsBorderLine, &Line::styleChanged, this, &ProcessBehaviorChart::labelsBorderStyleChanged);
241 connect(d->labelsBorderLine, &Line::widthChanged, this, &ProcessBehaviorChart::labelsBorderWidthChanged);
242 connect(d->labelsBorderLine, &Line::colorChanged, this, &ProcessBehaviorChart::labelsBorderColorChanged);
243 connect(d->labelsBorderLine, &Line::opacityChanged, this, &ProcessBehaviorChart::labelsBorderOpacityChanged);
244}
245
246void ProcessBehaviorChart::renameInternalCurves() {
247 Q_D(ProcessBehaviorChart);

Callers

nothing calls this directly

Calls 3

setParentGraphicsItemMethod · 0.45
graphicsItemMethod · 0.45

Tested by

no test coverage detected