void MainWindow::on_pushButton_clicked()
{
QGraphicsOpacityEffect *effect = new QGraphicsOpacityEffect();
ui->label->setGraphicsEffect(effect);
QPropertyAnimation *anim = new QPropertyAnimation(effect,"opacity");
anim->setDuration(1000);
anim->setStartValue(1.0);
anim->setEndValue(0.0);
anim->setEasingCurve(QEasingCurve::OutQuad);
connect(anim, &QPropertyAnimation::finished, [=]()
{
ui->label->setText("gone");
});
anim->start(QAbstractAnimation::DeleteWhenStopped);
}
void MainWindow::on_pushButton_clicked()
{
QGraphicsOpacityEffect *effect = new QGraphicsOpacityEffect();
ui->label->setGraphicsEffect(effect);
QPropertyAnimation *anim = new QPropertyAnimation(effect,"opacity");
anim->setDuration(1000);
anim->setStartValue(1.0);
anim->setEndValue(0.0);
anim->setEasingCurve(QEasingCurve::OutQuad);
connect(anim, &QPropertyAnimation::finished, [=]()
{
ui->label->setText("gone");
});
anim->start(QAbstractAnimation::DeleteWhenStopped);
}
To copy to clipboard, switch view to plain text mode
Hope this will help
Bookmarks