rawfool
27th July 2013, 12:22
In QMainWindow, I'm initializing a CWorker class and this CWorker tries to find if a particular shared memory is available. If shared memory isn't available then I should quit the application (i.e., QMainWindow).
I'm trying to check this in try.. catch. So if the control goes to catch, I'm trying to display a QMessageBox & exit(this->close) the application. While doing this, the application is not closing gracefully.
CMainWindow::CMainWindow(QWidget *parent)
: QMainWindow(parent)
{
....
....
try
{
worker = new CWorker();
}
catch(...)
{
QMessageBox::information(this, "Title",
"Message text goes here");
quit();
}
....
....
....
}
I tried qApp->quit() and QCoreApplication::quit(); also but same result;
Please find the attached screenshot of the error message after the application goes to catch().
9372
I'm trying to check this in try.. catch. So if the control goes to catch, I'm trying to display a QMessageBox & exit(this->close) the application. While doing this, the application is not closing gracefully.
CMainWindow::CMainWindow(QWidget *parent)
: QMainWindow(parent)
{
....
....
try
{
worker = new CWorker();
}
catch(...)
{
QMessageBox::information(this, "Title",
"Message text goes here");
quit();
}
....
....
....
}
I tried qApp->quit() and QCoreApplication::quit(); also but same result;
Please find the attached screenshot of the error message after the application goes to catch().
9372