ui->setupUi(this);
this->setAutoFillBackground(true);
animation = new QPropertyAnimation(this, "palette");
animation->setDuration(100);
animation->setStartValue(start);
animation->setEndValue(stop);
animation->setLoopCount(-1);
connect(ui->pushButton, &QPushButton::clicked,
[&](){
qDebug() << "Animation button clicked";
animation->start();
});
ui->setupUi(this);
this->setAutoFillBackground(true);
QPalette start, stop;
start.setColor(QPalette::Window, QColor(0,255,0));
stop.setColor(QPalette::Window, QColor(255,0,0));
animation = new QPropertyAnimation(this, "palette");
animation->setDuration(100);
animation->setStartValue(start);
animation->setEndValue(stop);
animation->setLoopCount(-1);
connect(ui->pushButton, &QPushButton::clicked,
[&](){
qDebug() << "Animation button clicked";
animation->start();
});
To copy to clipboard, switch view to plain text mode
Bookmarks