diff --git a/src/app/mainwindow.cpp b/src/app/mainwindow.cpp index 17c1915bc..c7d01b2f5 100644 --- a/src/app/mainwindow.cpp +++ b/src/app/mainwindow.cpp @@ -1565,14 +1565,8 @@ void MainWindow::FullParseFile() #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif - QMessageBox msgBox; - msgBox.setWindowTitle(tr("Error!")); - msgBox.setText(tr("Error parsing file.")); - msgBox.setInformativeText("std::bad_alloc"); - msgBox.setStandardButtons(QMessageBox::Ok); - msgBox.setDefaultButton(QMessageBox::Ok); - msgBox.setIcon(QMessageBox::Warning); - msgBox.exec(); + QMessageBox::critical(this, tr("Critical error!"), tr("Error parsing file (std::bad_alloc)."), QMessageBox::Ok, + QMessageBox::Ok); #ifndef QT_NO_CURSOR QApplication::setOverrideCursor(Qt::WaitCursor); #endif diff --git a/src/app/xml/vpattern.cpp b/src/app/xml/vpattern.cpp index 353d09fda..3ad86dced 100644 --- a/src/app/xml/vpattern.cpp +++ b/src/app/xml/vpattern.cpp @@ -687,14 +687,8 @@ void VPattern::LiteParseTree() #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif - QMessageBox msgBox; - msgBox.setWindowTitle(tr("Error!")); - msgBox.setText(tr("Error parsing file.")); - msgBox.setInformativeText("std::bad_alloc"); - msgBox.setStandardButtons(QMessageBox::Ok); - msgBox.setDefaultButton(QMessageBox::Ok); - msgBox.setIcon(QMessageBox::Warning); - msgBox.exec(); + QMessageBox::critical(nullptr, tr("Critical error!"), tr("Error parsing file (std::bad_alloc)."), QMessageBox::Ok, + QMessageBox::Ok); #ifndef QT_NO_CURSOR QApplication::setOverrideCursor(Qt::WaitCursor); #endif