From c2e349f1c38b55fd12f8ae537e754fa6658ab631 Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周一, 01 1月 2024 20:21:34 +0800 Subject: [PATCH] Tested 5.12.8 --- examples/qml/main.cpp | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-) diff --git a/examples/qml/main.cpp b/examples/qml/main.cpp index 4dbda50..1a898bb 100644 --- a/examples/qml/main.cpp +++ b/examples/qml/main.cpp @@ -1,18 +1,29 @@ -#include <QGuiApplication> -#include <QQmlApplicationEngine> +// Copyright (C) 2023-2024 Stdware Collections +// SPDX-License-Identifier: Apache-2.0 -int main(int argc, char *argv[]) -{ - qputenv("QT_WIN_DEBUG_CONSOLE", "1"); +#include <QtGui/QGuiApplication> +#include <QtQml/QQmlApplicationEngine> + +#include <QWKQuick/qwkquickglobal.h> + +int main(int argc, char *argv[]) { + qputenv("QT_WIN_DEBUG_CONSOLE", "attach"); qputenv("QSG_INFO", "1"); -#if 1 - qputenv("QSG_RHI_BACKEND", "d3d12"); - qputenv("QSG_RHI_HDR", "scrgb"); - qputenv("QT_QPA_DISABLE_REDIRECTION_SURFACE", "1"); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + qputenv("QT_QUICK_CONTROLS_STYLE", "Basic"); +#else + qputenv("QT_QUICK_CONTROLS_STYLE", "Default"); #endif - QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); +#if 0 + qputenv("QSG_RHI_BACKEND", "opengl"); + //qputenv("QSG_RHI_HDR", "scrgb"); + //qputenv("QT_QPA_DISABLE_REDIRECTION_SURFACE", "1"); + QGuiApplication::setHighDpiScaleFactorRoundingPolicy( + Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); +#endif QGuiApplication application(argc, argv); QQmlApplicationEngine engine; + QWK::registerTypes(&engine); engine.load(QUrl(QStringLiteral("qrc:///main.qml"))); return application.exec(); } \ No newline at end of file -- Gitblit v1.9.1