From bd5a102d23a3da3192b9cc02ccaf0de77b45c72e Mon Sep 17 00:00:00 2001
From: Zhao Yuhang <2546789017@qq.com>
Date: 周六, 23 12月 2023 13:54:34 +0800
Subject: [PATCH] update qmsetup

---
 examples/qml/main.cpp |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/examples/qml/main.cpp b/examples/qml/main.cpp
index 4dbda50..e9cf0a7 100644
--- a/examples/qml/main.cpp
+++ b/examples/qml/main.cpp
@@ -1,18 +1,26 @@
-#include <QGuiApplication>
-#include <QQmlApplicationEngine>
+#include <QtGui/QGuiApplication>
+#include <QtQml/QQmlApplicationEngine>
 
-int main(int argc, char *argv[])
-{
-    qputenv("QT_WIN_DEBUG_CONSOLE", "1");
+#include <QWKQuick/qwkquickglobal.h>
+
+int main(int argc, char *argv[]) {
+    qputenv("QT_WIN_DEBUG_CONSOLE", "attach");
     qputenv("QSG_INFO", "1");
-#if 1
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+    qputenv("QT_QUICK_CONTROLS_STYLE", "Basic");
+#else
+    qputenv("QT_QUICK_CONTROLS_STYLE", "Default");
+#endif
+#if 0
     qputenv("QSG_RHI_BACKEND", "d3d12");
     qputenv("QSG_RHI_HDR", "scrgb");
     qputenv("QT_QPA_DISABLE_REDIRECTION_SURFACE", "1");
 #endif
-    QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
+    QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
+        Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
     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