View Single Post
Posts: 34 | Thanked: 2 times | Joined on Feb 2010
#12
I think I had a similar situation when i used QMessageBox.

In my case, I had a QNetworkReply and on the slot received from error() signal i created a QMessageBox using the static function QMessageBox::warning.

After the messagebox show and accept, the application was crashing from time to time.

I think the static creation of QMessageBox is modal and it blocks the event loop.

I had a better behaviour when i changed the static creation of the message box with a non modal one.

Code:
 QMessageBox *msgBox = new QMessageBox( this );
    msgBox->setWindowTitle( tr(" HTTP Error "));
    msgBox->setIcon( QMessageBox::Warning );
    msgBox->setText(tr("Error during download:   %1")
                    .arg(QString( stringError ) ));
    msgBox->show();
On the hideEvent function you can close the dialog.

Hope this can help.
 

The Following User Says Thank You to flgor For This Useful Post: