2026-07-11 16:02:57 +08:00

35 lines
881 B
C++

#include "mainwindow.h"
#include <QApplication>
#include <QIcon>
#include <QMessageBox>
#include <QObject>
#include "AuthView.h"
#include "SingleInstanceManager.h"
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
app.setWindowIcon(QIcon(":/common/resource/logo.png"));
SingleInstanceManager instanceManager("ParkingSpaceGuideApp_SingleInstance_Key");
if (instanceManager.isAnotherInstanceRunning()) {
QMessageBox messageBox;
messageBox.setWindowTitle(QObject::tr("应用已运行"));
messageBox.setText(QObject::tr("停车引导程序已在运行。"));
messageBox.addButton(QObject::tr("确定"), QMessageBox::AcceptRole);
messageBox.exec();
return 0;
}
if (!AuthView::CheckAndShow(nullptr)) {
return 0;
}
MainWindow window;
window.show();
return app.exec();
}