! * \brief WorksheetElementPrivate::mapPlotAreaToParent * Mapping a point from the PlotArea (CartesianPlot::plotArea) coordinates to the parent * coordinates of this item * Needed because in some cases the parent is not the PlotArea, but a child of it (Marker/InfoElement) * IMPORTANT: function is also used in Custompoint, so when changing anything, change it also there * \param point point i
| 1080 | * \return point in parent coordinates |
| 1081 | */ |
| 1082 | QPointF WorksheetElementPrivate::mapPlotAreaToParent(QPointF point) const { |
| 1083 | auto* parent = q->parent(AspectType::CartesianPlot); |
| 1084 | if (parent) { |
| 1085 | auto* plot = static_cast<CartesianPlot*>(parent); |
| 1086 | // first mapping to item coordinates and from there back to parent |
| 1087 | // WorksheetinfoElement: parentItem()->parentItem() == plot->graphicsItem() |
| 1088 | // plot->graphicsItem().pos() == plot->plotArea()->graphicsItem().pos() |
| 1089 | return mapToParent(mapFromItem(plot->plotArea()->graphicsItem(), point)); |
| 1090 | } |
| 1091 | |
| 1092 | return point; // don't map if no parent set. Then it's during load |
| 1093 | } |
| 1094 | |
| 1095 | void WorksheetElementPrivate::hoverEnterEvent(QGraphicsSceneHoverEvent*) { |
| 1096 | if (!isSelected()) |
nothing calls this directly
no test coverage detected