1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #include "mainwindow.h"
- #include "loginwindow.h"
- #include "logger.h"
- #include "fireWidget/firingwidget.h"
- #include <QApplication>
- #include <QFile>
- #include <QTextStream>
- #include <QQuickWindow> // 关键头文件
- int main(int argc, char *argv[])
- {
- QApplication a(argc, argv);
- //TODO: 确认硬件配置,是否需要使用GPU及设备是否安装驱动
- //QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); // 强制使用 ANGLE (OpenGL ES over DirectX/Vulkan)
- QQuickWindow::setSceneGraphBackend("software"); // 兼容性: 禁用GPU
- // 加载 QSS 文件
- QFile styleFile(":/qss/qss/tableview.qss");
- if (styleFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
- QTextStream stream(&styleFile);
- QString styleSheet = stream.readAll();
- a.setStyleSheet(styleSheet);
- styleFile.close();
- }
- // // 获取屏幕信息
- // QScreen *screen = QGuiApplication::primaryScreen();
- // QRect screenGeometry = screen->geometry();
- // int screenWidth = screenGeometry.width();
- // int screenHeight = screenGeometry.height();
- // logger
- Logger::getInstance("application.log");
- // Optional: Set logger configurations
- Logger::getInstance().setMaxFileSize(2 * 1024 * 1024); // 2 MB
- Logger::getInstance().setMaxBackupFiles(3); // Keep 3 backup files
- Logger::getInstance().info("Application started from main.");
- //MainWindow w;
- // Page w;
- // pageTest w;
- LoginWindow w;
- //loginWindow.show();
- // 设置应用程序图标
- a.setWindowIcon(QIcon(":/icons/icons/l634z-aceaj-001.ico"));
- // w.resize(screenWidth * 1, screenHeight * 0.95);
- // firingWidget w;
- w.show();
- return a.exec();
- }
|