I have a QMessageBox
and I put an animated gif on this Dialog with QLabel
and inside QMovie
instead of an icon. But there is a problem with the gif. When I refresh the screen somehow QMessageBox
is working but the gif is not visible anymore.
QMessageBox msgBox(this);
msgBox.setWindowTitle("Warning");
msgBox.setText(" This element is UNDER CONSTRUCTION!");
QLabel* label = new QLabel(&msgBox);
label-> setWindowFlags(Qt::FramelessWindowHint);
QPixmap p("Resources/Images/General/construct.gif");
label->setPixmap(p);
label->setFixedHeight(40);
label->setFixedWidth(45);
QMovie *movie = new QMovie("Resources/Images/General/construct.gif");
label->setMovie(movie);
movie->start();
label->show();
QAbstractButton *myYesButton = msgBox.addButton("I accept risk!", QMessageBox::YesRole);
QAbstractButton *myNoButton = msgBox.addButton("Cancel", QMessageBox::NoRole);
msgBox.exec();
if(msgBox.clickedButton() == myNoButton) return;