【Qt】Qt编译是出现Warning QT_DEVICE_PIXEL_RATIO is deprecated

00. 目录

01. 问题描述

Qt 5.12.12 Windows10系统

编译时出现如下问题:

20:27:35: Starting E:\Program Data\Qt5\build-1Hello-Desktop_Qt_5_12_12_MinGW_64_bit-Debug\debug\1Hello.exe ...
Warning: QT_DEVICE_PIXEL_RATIO is deprecated. Instead use:
   QT_AUTO_SCREEN_SCALE_FACTOR to enable platform plugin controlled per-screen factors.
   QT_SCREEN_SCALE_FACTORS to set per-screen factors.
   QT_SCALE_FACTOR to set the application global scale factor.
20:27:46: E:\Program Data\Qt5\build-1Hello-Desktop_Qt_5_12_12_MinGW_64_bit-Debug\debug\1Hello.exe exited with code 0

02. 问题分析

Warning: QT_DEVICE_PIXEL_RATIO is deprecated, Qt设备像素缩放已经被弃用。

03. 问题解决

删除 用户和系统的 环境变量。
“QT_DEVICE_PIXEL_RATIO”,键为"auto" 。重启电脑。
在这里插入图片描述

系统变量和Administrator的用户变量都需要删除。

04. 问题验证

解决问题之后重新编译

20:42:34: 为项目1Hello执行步骤 ...
20:42:34: 配置没有改变, 跳过 qmake 步骤。
20:42:34: 正在启动 "D:\Qt\Qt5.12.12\Tools\mingw730_64\bin\mingw32-make.exe" -j8

D:/Qt/Qt5.12.12/Tools/mingw730_64/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'E:/Program Data/Qt5/build-1Hello-Desktop_Qt_5_12_12_MinGW_64_bit-Debug'
mingw32-make[1]: Nothing to be done for 'first'.
mingw32-make[1]: Leaving directory 'E:/Program Data/Qt5/build-1Hello-Desktop_Qt_5_12_12_MinGW_64_bit-Debug'
20:42:36: 进程"D:\Qt\Qt5.12.12\Tools\mingw730_64\bin\mingw32-make.exe"正常退出。
20:42:36: Elapsed time: 00:01.

05. 附录

猜你喜欢

转载自blog.csdn.net/dengjin20104042056/article/details/131542776
QT