| 387 | } |
| 388 | |
| 389 | void 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 | |
| 402 | void DatapickerImageView::scalingTime() { |
| 403 | qreal factor = 1.0 + qreal(m_numScheduledScalings) / 300.0; |
nothing calls this directly
no test coverage detected