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