2026-03-01 18:11:32 +08:00

26 lines
714 B
C++

#include "mainwindow.h"
#include <QApplication>
#include "SingleInstanceManager.h"
#include "StyledMessageBox.h"
#include "DemoControlPresenter.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// 注册自定义类型,用于跨线程信号槽传递
qRegisterMetaType<WorkflowStep>("WorkflowStep");
qRegisterMetaType<DetectionResult>("DetectionResult");
// 单例检查
SingleInstanceManager singleInstance("DemoControlApp");
if (singleInstance.isAnotherInstanceRunning()) {
StyledMessageBox::information(nullptr, "应用程序已运行", "主控程序已经在运行中!");
return 0;
}
MainWindow w;
w.show();
return a.exec();
}