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

Method wheelEvent

src/frontend/worksheet/WorksheetView.cpp:845–862  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

843}
844
845void WorksheetView::wheelEvent(QWheelEvent* event) {
846 if (isInteractive() && (m_mouseMode == MouseMode::ZoomSelection || (QApplication::keyboardModifiers() & Qt::ControlModifier))) {
847 if (!zoomFitNoneAction)
848 initActions();
849 zoomFitNoneAction->setChecked(true);
850 m_worksheet->setZoomFit(Worksheet::ZoomFit::None);
851 updateScrollBarPolicy();
852
853 // https://wiki.qt.io/Smooth_Zoom_In_QGraphicsView
854 QPoint numDegrees = event->angleDelta() / 8;
855 int numSteps = numDegrees.y() / 15; // see QWheelEvent documentation
856 zoom(numSteps);
857 } else
858 QGraphicsView::wheelEvent(event);
859
860 if (m_magnificationWindow && m_magnificationWindow->isVisible())
861 updateMagnificationWindow(mapToScene(event->position().toPoint()));
862}
863
864void WorksheetView::zoom(int numSteps) {
865 m_numScheduledScalings += numSteps;

Callers

nothing calls this directly

Calls 4

setZoomFitMethod · 0.80
positionMethod · 0.80
yMethod · 0.45
isVisibleMethod · 0.45

Tested by

no test coverage detected