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

Method addImage

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

Source from the content-addressed store, hash-verified

2176}
2177
2178void CartesianPlot::addImage() {
2179 auto* image = new Image(i18n("Image"));
2180
2181 Q_D(CartesianPlot);
2182 if (d->calledFromContextMenu) {
2183 auto position = image->position();
2184 position.point = image->parentPosToRelativePos(d->scenePos, position);
2185 position.point = image->align(position.point, image->graphicsItem()->boundingRect(), image->horizontalAlignment(), image->verticalAlignment(), false);
2186 image->setPosition(position);
2187 d->calledFromContextMenu = false;
2188 }
2189
2190 // make the new image somewhat smaller so it's completely visible also on smaller plots
2191 image->setWidth((int)Worksheet::convertToSceneUnits(1.0, Worksheet::Unit::Centimeter));
2192
2193 this->addChild(image);
2194 image->retransform();
2195}
2196
2197void CartesianPlot::addCustomPoint() {
2198 Q_D(CartesianPlot);

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
setWidthMethod · 0.45
addChildMethod · 0.45
retransformMethod · 0.45

Tested by

no test coverage detected