Hi guys
I solved this problem by adding a sleeping time duration in my worker thread preventing it from returning too quick. Then the message box gets shown properly and closed properly.
// member function to do the job
bool MainWindow::waitReply() {
// Here to sleep for a while
QThread::sleep(2);
bool received_valid_reply = false;
while (!m_waitReplyCancelled) {
if (Something Is Received) {
received_valid_reply = true;
return received_valid_reply;
}
}
return received_valid_reply;
}