Fix error prompt bug.

This commit is contained in:
krad
2021-10-21 13:35:45 +08:00
parent e2775f7f61
commit 89fa9a290f

View File

@@ -87,9 +87,15 @@ MainWindow::MainWindow(QWidget *parent) :
layout->addWidget(tab);
ui->centralWidget->setLayout(layout);
this->setWindowFlags (Qt::Window);
connect(EventCenter::Default(),&EventCenter::GUIErrorRaise,[=](){
connect(EventCenter::Default(),&EventCenter::GUIErrorRaise,[=](QObject*,QObject* msg){
if (!msgDialog) msgDialog = new GUIMessageDialog(this);
msgDialog->showMessage("Something went error!");
if (msg)
{
QString* str = (QString*)msg;
msgDialog->showMessage(*str);
} else {
msgDialog->showMessage("Something went error!");
}
msgDialog->showExitButton();
msgDialog->stopLoading();
msgDialog->showFullScreen();