MCPcopy Create free account
hub / github.com/CieNTi/serial_port_plotter / processRectZoom

Method processRectZoom

qcustomplot/qcustomplot.cpp:15384–15394  ·  view source on GitHub ↗

! \internal This slot is connected to the selection rect's \ref QCPSelectionRect::accepted signal when \ref setSelectionRectMode is set to \ref QCP::srmZoom. It determines which axis rect was the origin of the selection rect judging by the starting point of the selection, and then zooms the axes defined via \ref QCPAxisRect::setRangeZoomAxes to the provided \a rect (see \ref QCPAxisR

Source from the content-addressed store, hash-verified

15382 \see processRectSelection
15383*/
15384void QCustomPlot::processRectZoom(QRect rect, QMouseEvent *event)
15385{
15386 Q_UNUSED(event)
15387 if (QCPAxisRect *axisRect = axisRectAt(rect.topLeft()))
15388 {
15389 QList<QCPAxis*> affectedAxes = QList<QCPAxis*>() << axisRect->rangeZoomAxes(Qt::Horizontal) << axisRect->rangeZoomAxes(Qt::Vertical);
15390 affectedAxes.removeAll(static_cast<QCPAxis*>(0));
15391 axisRect->zoom(QRectF(rect), affectedAxes);
15392 }
15393 replot(rpQueuedReplot); // always replot to make selection rect disappear
15394}
15395
15396/*! \internal
15397

Callers

nothing calls this directly

Calls 2

rangeZoomAxesMethod · 0.80
zoomMethod · 0.80

Tested by

no test coverage detected