* @brief 环境: 本工程可以用 Qt 5.15.2 和 6.8.3 LTS 版本同时可编译通过 * @param IDE: 推荐直接只用 Qt Creator 打开 CMakeLists.txt 进行构建 * @param Other: 也可以自行 CMake 转 .sln 使用 Visual Studio 2022 构建 * @note 更多项目集: https://product.xmuli.tech/ */
| 36 | * @note 更多项目集: https://product.xmuli.tech/ |
| 37 | */ |
| 38 | int main(int argc, char *argv[]) |
| 39 | { |
| 40 | |
| 41 | // 启用高 DPI 缩放 |
| 42 | #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) |
| 43 | qDebug() << "Using Qt 6 or newer"; |
| 44 | QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); // support 1.25 1.5 |
| 45 | #else |
| 46 | qDebug() << "Using Qt 5"; |
| 47 | // QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); |
| 48 | QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); |
| 49 | #endif |
| 50 | |
| 51 | qApp->setOrganizationName(QStringLiteral("XMuli")); // 因多处使用 QSettings,故声明组织等信息 |
| 52 | qApp->setOrganizationDomain(QStringLiteral("github.com/XMuli")); |
| 53 | QApplication a(argc, argv); |
| 54 | |
| 55 | ChooseMainWindow c; |
| 56 | c.show(); |
| 57 | |
| 58 | return a.exec(); |
| 59 | } |
nothing calls this directly
no outgoing calls
no test coverage detected