Hello Everyone,

I have to create a QmessgeBox in thread function. But getting runtime error at QMessageBox * msgBox this line.
fatal: assert failure in qwidget: "widgets must be created in the gui thread.", file kernel\qwidget.cpp:1125.
Please assist me.

bool MainWindow::thread_cleaning()
{
QMessageBox * msgBox;
msgBox->setWindowTitle("Confirmation");
msgBox->setText("Match Data already exists in current project do you want to override");
msgBox->setStandardButtons(QMessageBox::Yes);
msgBox->addButton(QMessageBox::No);
msgBox->setDefaultButton(QMessageBox::No);
if (msgBox->exec() == QMessageBox::No)
{
qDebug() << "Incremental SFM skipped" << endl;;
return true;
}
return true;
}