MCPcopy Create free account
hub / github.com/IENT/YUView / mouseMoveEvent

Method mouseMoveEvent

YUViewLib/src/ui/views/PlotViewWidget.cpp:228–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228void PlotViewWidget::mouseMoveEvent(QMouseEvent *mouseMoveEvent)
229{
230 MoveAndZoomableView::mouseMoveEvent(mouseMoveEvent);
231
232 QMap<unsigned, QMap<unsigned, unsigned>> newHoverePointIndexPerStreamAndPlot;
233 if (this->model)
234 {
235 const auto pos = mouseMoveEvent->pos();
236 const auto mouseHoverPos = this->convertPixelPosToPlotPos(pos);
237 for (unsigned streamIndex = 0; streamIndex < this->model->getNrStreams(); streamIndex++)
238 {
239 const auto streamParam = model->getStreamParameter(streamIndex);
240 for (unsigned plotIndex = 0; plotIndex < streamParam.getNrPlots(); plotIndex++)
241 {
242 const auto pointIndex = model->getPointIndex(streamIndex, plotIndex, mouseHoverPos);
243 if (pointIndex)
244 newHoverePointIndexPerStreamAndPlot[streamIndex][plotIndex] = *pointIndex;
245 }
246 }
247 mouseMoveEvent->accept();
248 }
249
250 if (this->currentlyHoveredPointPerStreamAndPlot != newHoverePointIndexPerStreamAndPlot)
251 {
252 this->currentlyHoveredPointPerStreamAndPlot = newHoverePointIndexPerStreamAndPlot;
253 update();
254 }
255}
256
257void PlotViewWidget::setMoveOffset(QPointF offset)
258{

Callers

nothing calls this directly

Calls 6

posMethod · 0.80
getNrPlotsMethod · 0.80
getPointIndexMethod · 0.80
getNrStreamsMethod · 0.45
getStreamParameterMethod · 0.45

Tested by

no test coverage detected