0

I want to show the user a loading gif while other window is executing. When my graphdialog.ui page executes, showdb.ui closes itself, so I didn't do movie->stop() step. But I am getting the error:

The program has unexpectedly finished. The process was ended forcefully.

What is the correct way to do this?

Here is the sample of my code:

showdb.cpp

void show_db::on_pushButton_2_clicked()
{
    QMovie *movie = new QMovie("qrc:/images/loadinggif.gif");
    this->ui->label->setMovie(movie);
    this->ui->label->show();
    this->ui->lineEdit->show();
    movie->start();

    GraphDialog grapghdialog(NULL,NULL);
    grapghdialog.setModal(true);  //sets second window here
    grapghdialog.exec();  //to show
}
scopchanov
  • 7,966
  • 10
  • 40
  • 68

0 Answers0