Plasma
Go to the documentation of this file.
29 FadeAnimation::FadeAnimation(
QObject *parent)
30 : EasingAnimation(parent),
36 FadeAnimation::~FadeAnimation()
40 void FadeAnimation::setStartOpacity(qreal factor)
42 m_startOpacity = qBound(qreal(0.0), factor, qreal(1.0));
45 qreal FadeAnimation::startOpacity()
const
47 return m_startOpacity;
50 void FadeAnimation::setTargetOpacity(qreal factor)
52 m_targetOpacity = qBound(qreal(0.0), factor, qreal(1.0));
55 qreal FadeAnimation::targetOpacity()
const
57 return m_targetOpacity;
60 void FadeAnimation::updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
67 if (oldState == Stopped && newState == Running) {
68 w->
setOpacity(direction() == Forward ? m_startOpacity : m_targetOpacity);
69 }
else if (newState == Stopped) {
70 w->
setOpacity(direction() == Forward ? m_targetOpacity : m_startOpacity);
74 void FadeAnimation::updateEffectiveTime(
int currentTime)
78 qreal delta = currentTime / qreal(duration());
79 delta *= m_startOpacity - m_targetOpacity;
void setOpacity(qreal opacity)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:12 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.