#include #include #include #include "Login.h" #include "Global.h" #include #include #include #pragma comment(lib,"D:\\reverse\\vmprotect33\\Lib\\Windows\\VMProtectSDK64.lib") #include "AppInstanceManager.h" #include "Utils.h" #include "StyleLoader.h" #include "MessageHandle.h" int main(int argc, char* argv[]) { // 禁用GPU加速(如果黑屏) qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-gpu"); // 启用软件渲染 qputenv("QT_QUICK_BACKEND", "software"); qputenv("QT_XCB_FORCE_SOFTWARE_OPENGL", "1"); // 检测SSL兼容 if (!QSslSocket::supportsSsl()) { QMessageBox::warning(nullptr,"警告","OpenSSL组件异常"); return 0; } // DPI兼容 if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); } // 设置全局字体 QApplication a(argc, argv); if (AppInstanceManager::isAlreadyRunning()) { return 0; // 直接退出新实例 } qInstallMessageHandler(message_handle); qDebug() << "test log"; // 加载QSS样式 QString style = StyleLoader::loadStyleFromResource(); if (!style.isEmpty()) { a.setStyleSheet(style); } // 设置调试端口临时环境变量 qputenv("QTWEBENGINE_REMOTE_DEBUGGING", "7777"); // 强制指定语言为简体中文 // qputenv("LANG", "zh_CN.UTF-8"); //QFont font("黑体",10); //a.setFont(font); // 初始化配置 g_config = new Config(); // 初始化验证 g_verify = new Verify("https://gendan.xyz", "72", "NAO87ZGQXTXR1HLFHGL3NSLXD", VERSION); // 检测版本更新 if (g_verify->checkUpdate()) { Login w; w.show(); return a.exec(); } else { QProcess::execute(QCoreApplication::applicationDirPath() + "/Update.exe"); QApplication::quit(); } return 0; }