From 97a65514f04eb2db667c5ee22ec99472a8dc78c9 Mon Sep 17 00:00:00 2001
From: SineStriker <trueful@163.com>
Date: 周日, 17 12月 2023 16:09:06 +0800
Subject: [PATCH] Test on Mac

---
 examples/mainwindow/main.cpp |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/examples/mainwindow/main.cpp b/examples/mainwindow/main.cpp
index 0e29f11..8bbaab3 100644
--- a/examples/mainwindow/main.cpp
+++ b/examples/mainwindow/main.cpp
@@ -1,4 +1,6 @@
-#include <QApplication>
+#include <QtWidgets/QApplication>
+#include <QtGui/QFont>
+#include <QtCore/QDebug>
 
 #include "mainwindow.h"
 
@@ -12,8 +14,19 @@
     qputenv("QSG_RHI_HDR", "scrgb");
     qputenv("QT_QPA_DISABLE_REDIRECTION_SURFACE", "1");
 #endif
-    QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
+
+    QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
+        Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
     QApplication a(argc, argv);
+
+#ifdef Q_OS_WINDOWS
+    a.setFont([]() {
+        QFont f(QStringLiteral("Microsoft YaHei UI"));
+        f.setPixelSize(15);
+        return f;
+    }());
+#endif
+
     MainWindow w;
     w.show();
     return a.exec();

--
Gitblit v1.9.1