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

Method addTextLabel

src/backend/worksheet/plots/cartesian/CartesianPlot.cpp:2161–2176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2159}
2160
2161void CartesianPlot::addTextLabel() {
2162 auto* label = new TextLabel(i18n("Text Label"), this);
2163
2164 Q_D(CartesianPlot);
2165 if (d->calledFromContextMenu) {
2166 auto position = label->position();
2167 position.point = label->parentPosToRelativePos(d->scenePos, position);
2168 position.point = label->align(position.point, label->graphicsItem()->boundingRect(), label->horizontalAlignment(), label->verticalAlignment(), false);
2169 label->setPosition(position);
2170 d->calledFromContextMenu = false;
2171 }
2172
2173 this->addChild(label);
2174 label->setParentGraphicsItem(graphicsItem());
2175 label->retransform();
2176}
2177
2178void CartesianPlot::addImage() {
2179 auto* image = new Image(i18n("Image"));

Callers 1

keyPressEventMethod · 0.80

Calls 11

positionMethod · 0.80
alignMethod · 0.80
horizontalAlignmentMethod · 0.80
verticalAlignmentMethod · 0.80
boundingRectMethod · 0.45
graphicsItemMethod · 0.45
setPositionMethod · 0.45
addChildMethod · 0.45
setParentGraphicsItemMethod · 0.45
retransformMethod · 0.45

Tested by

no test coverage detected