parent
68e8616102
commit
a623bd5311
|
@ -52,6 +52,7 @@ void VMainGraphicsView::wheelEvent(QWheelEvent *event)
|
||||||
}
|
}
|
||||||
|
|
||||||
QTimeLine *anim = new QTimeLine(350, this);
|
QTimeLine *anim = new QTimeLine(350, this);
|
||||||
|
Q_ASSERT(anim != 0);
|
||||||
anim->setUpdateInterval(20);
|
anim->setUpdateInterval(20);
|
||||||
|
|
||||||
connect(anim, &QTimeLine::valueChanged, this, &VMainGraphicsView::scalingTime);
|
connect(anim, &QTimeLine::valueChanged, this, &VMainGraphicsView::scalingTime);
|
||||||
|
@ -62,9 +63,10 @@ void VMainGraphicsView::wheelEvent(QWheelEvent *event)
|
||||||
void VMainGraphicsView::scalingTime(qreal x)
|
void VMainGraphicsView::scalingTime(qreal x)
|
||||||
{
|
{
|
||||||
Q_UNUSED(x);
|
Q_UNUSED(x);
|
||||||
qreal factor = 1.0 + static_cast<qreal>(_numScheduledScalings) / 300.0;
|
qreal factor = 1.0;
|
||||||
if (QApplication::keyboardModifiers() == Qt::ControlModifier)
|
if (QApplication::keyboardModifiers() == Qt::ControlModifier)
|
||||||
{// If you press CTRL this code will be executed
|
{// If you press CTRL this code will be executed
|
||||||
|
factor = 1.0 + static_cast<qreal>(_numScheduledScalings) / 300.0;
|
||||||
scale(factor, factor);
|
scale(factor, factor);
|
||||||
emit NewFactor(factor);
|
emit NewFactor(factor);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user