From a1199a9e9c3f435b22adbd4ee864534301fb7d13 Mon Sep 17 00:00:00 2001 From: zhuzichu Date: Thu, 24 Aug 2023 16:02:41 +0800 Subject: [PATCH] update --- example/src/main.cpp | 9 ++++++++- example/src/stdafx.h | 4 ---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/example/src/main.cpp b/example/src/main.cpp index a9562905..d5df129e 100644 --- a/example/src/main.cpp +++ b/example/src/main.cpp @@ -14,8 +14,15 @@ FRAMELESSHELPER_USE_NAMESPACE - int main(int argc, char *argv[]) +int main(int argc, char *argv[]) { +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) + QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); +#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) + QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); +#endif +#endif //将样式设置为Basic,不然会导致组件显示异常 qputenv("QT_QUICK_CONTROLS_STYLE","Basic"); FramelessHelper::Quick::initialize(); diff --git a/example/src/stdafx.h b/example/src/stdafx.h index a7581723..b0fd29a0 100644 --- a/example/src/stdafx.h +++ b/example/src/stdafx.h @@ -1,7 +1,3 @@ -//#if defined(_MSC_VER) && (_MSC_VER >= 1600) -//#pragma execution_character_set("utf-8") -//#endif - #ifndef STDAFX_H #define STDAFX_H