MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / itemAt

Method itemAt

pj_plotting/widget/src/PlotLegend.cpp:128–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128const QwtPlotItem* PlotLegend::itemAt(const QPoint& pos) const {
129 const QRect canvas_rect = parent_plot_->canvas()->rect();
130 if (collapsed_ || !isVisible() || !geometry(canvas_rect).contains(pos)) {
131 return nullptr;
132 }
133 for (auto* item : plotItems()) {
134 const auto geometries = legendGeometries(item);
135 if (!geometries.empty() && geometries.first().contains(pos)) {
136 return item;
137 }
138 }
139 return nullptr;
140}
141
142const QwtPlotItem* PlotLegend::processMousePressEvent(QMouseEvent* mouse_event) {
143 const QRect canvas_rect = parent_plot_->canvas()->rect();

Callers

nothing calls this directly

Calls 4

rectMethod · 0.80
canvasMethod · 0.45
containsMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected