| 12345678910111213141516171819202122232425262728293031 |
- #include "mainwindow.h"
- #include "core/CoreService.h"
- #include <QApplication>
- #include <QDebug>
- int main(int argc, char *argv[])
- {
- QApplication app(argc, argv);
- app.setStyle("Fusion");
- app.setWindowIcon(QIcon(":/qrc/icons/ads_icon.svg"));
-
- // 初始化核心服务(在界面创建之前)
- CoreService* coreService = CoreService::instance();
- if (!coreService->initialize()) {
- qCritical() << "Failed to initialize CoreService";
- return -1;
- }
-
- // 创建并显示主窗口
- MainWindow w;
- w.show();
-
- // 运行应用
- int result = app.exec();
-
- // 应用退出时关闭核心服务
- qDebug() << "Application exiting, shutting down core service...";
- coreService->shutdown();
-
- return result;
- }
|