diff --git a/centralwidget.cpp b/centralwidget.cpp index 73b2bca..5ae65a9 100644 --- a/centralwidget.cpp +++ b/centralwidget.cpp @@ -105,7 +105,8 @@ void CentralWidget::importJson() return; if(!machine->setGrammar(filename)) { - setStatus("请检查文件格式"); + QMessageBox::warning(this, "警告", "请检查文件格式"); + setStatus("导入失败"); return; }; setStatus(tr("导入成功")); diff --git a/centralwidget.h b/centralwidget.h index a04bd8a..149a0b8 100644 --- a/centralwidget.h +++ b/centralwidget.h @@ -12,6 +12,7 @@ #include #include #include +#include #include "turingmachine.h" #include "papertape.h"