MCPcopy Create free account
hub / github.com/KDE/gwenview / fadeTo

Method fadeTo

lib/documentview/documentview.cpp:339–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337 }
338
339 void fadeTo(qreal value)
340 {
341 if (mFadeAnimation.data()) {
342 qreal endValue = mFadeAnimation.data()->endValue().toReal();
343 if (qFuzzyCompare(value, endValue)) {
344 // Same end value, don't change the actual animation
345 return;
346 }
347 }
348 // Create a new fade animation
349 auto anim = new QPropertyAnimation(mOpacityEffect, "opacity");
350 anim->setStartValue(mOpacityEffect->opacity());
351 anim->setEndValue(value);
352 if (qFuzzyCompare(value, 1)) {
353 QObject::connect(anim, &QAbstractAnimation::finished, q, &DocumentView::slotFadeInFinished);
354 }
355 QObject::connect(anim, &QAbstractAnimation::finished, q, &DocumentView::isAnimatedChanged);
356 anim->setDuration(DocumentView::AnimDuration);
357 mFadeAnimation = anim;
358 Q_EMIT q->isAnimatedChanged();
359 anim->start(QAbstractAnimation::DeleteWhenStopped);
360 }
361
362 bool canPan() const
363 {

Callers 2

fadeInMethod · 0.45
fadeOutMethod · 0.45

Calls 3

opacityMethod · 0.80
dataMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected