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

Method zoom

src/frontend/datapicker/DatapickerImageView.cpp:389–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389void DatapickerImageView::zoom(int numSteps) {
390 m_numScheduledScalings += numSteps;
391 if (m_numScheduledScalings * numSteps < 0) // if user moved the wheel in another direction, we reset previously scheduled scalings
392 m_numScheduledScalings = numSteps;
393
394 auto* anim = new QTimeLine(350, this);
395 anim->setUpdateInterval(20);
396
397 connect(anim, &QTimeLine::valueChanged, this, &DatapickerImageView::scalingTime);
398 connect(anim, &QTimeLine::finished, this, &DatapickerImageView::animFinished);
399 anim->start();
400}
401
402void DatapickerImageView::scalingTime() {
403 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