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

Method zoom

src/frontend/worksheet/WorksheetView.cpp:864–880  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

862}
863
864void WorksheetView::zoom(int numSteps) {
865 m_numScheduledScalings += numSteps;
866 if (m_numScheduledScalings * numSteps < 0) // if user moved the wheel in another direction, we reset previously scheduled scalings
867 m_numScheduledScalings = numSteps;
868
869 if (!m_zoomTimeLine) {
870 m_zoomTimeLine = new QTimeLine(350, this);
871 m_zoomTimeLine->setUpdateInterval(20);
872 connect(m_zoomTimeLine, &QTimeLine::valueChanged, this, &WorksheetView::scalingTime);
873 connect(m_zoomTimeLine, &QTimeLine::finished, this, &WorksheetView::animFinished);
874 }
875
876 if (m_zoomTimeLine->state() == QTimeLine::Running)
877 m_zoomTimeLine->stop();
878
879 m_zoomTimeLine->start();
880}
881
882void WorksheetView::scalingTime() {
883 qreal factor = 1.0 + qreal(m_numScheduledScalings) / 300.0;

Callers

nothing calls this directly

Calls 2

setUpdateIntervalMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected