| 5 | #include <QSequentialAnimationGroup> |
| 6 | |
| 7 | FadingLabel::FadingLabel(QWidget* parent) : QLabel(parent) |
| 8 | { |
| 9 | effect = new QGraphicsOpacityEffect(this); |
| 10 | effect->setOpacity(0.0); |
| 11 | this->setGraphicsEffect(effect); |
| 12 | |
| 13 | fadeInOut = new QSequentialAnimationGroup(this); |
| 14 | fadeIn = new QPropertyAnimation(effect, "opacity"); |
| 15 | fadeIn->setDuration(150); |
| 16 | fadeIn->setEasingCurve(QEasingCurve::Type::OutCurve); |
| 17 | fadeIn->setStartValue(0); |
| 18 | fadeIn->setEndValue(1.0); |
| 19 | fadeOut = new QPropertyAnimation(effect, "opacity"); |
| 20 | fadeOut->setDuration(150); |
| 21 | fadeOut->setEasingCurve(QEasingCurve::Type::OutCurve); |
| 22 | fadeOut->setStartValue(1.0); |
| 23 | fadeOut->setEndValue(0.0); |
| 24 | |
| 25 | fadeInOut->addAnimation(fadeIn); |
| 26 | fadeInOut->addPause(3000); |
| 27 | fadeInOut->addAnimation(fadeOut); |
| 28 | } |
| 29 | |
| 30 | void FadingLabel::setAnimatedText(const QString &msg, bool highPriority) |
| 31 | { |
nothing calls this directly
no test coverage detected