我可以通过 API 设置 QT_AUTO_SCREEN_SCALE_FACTOR 行为吗?
Can I set QT_AUTO_SCREEN_SCALE_FACTOR behavior via API?
我可以通过 API 调用而不是环境变量来设置 QT_AUTO_SCREEN_SCALE_FACTOR 1
behavior 吗?我想检测我的 Qt 应用程序在高 dpi 屏幕上是否 运行,然后相应地设置缩放比例。
我试过设置在main
,which does not work
的开头
QProcessEnvironment::systemEnvironment().insert("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
It's meant to be used along with QProcess, to set the environment for
child processes. It cannot be used to change the current process's
environment.
跟进 Style sheets / Qt Designer support for high dpi screens?
以下应该有效
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
我可以通过 API 调用而不是环境变量来设置 QT_AUTO_SCREEN_SCALE_FACTOR 1
behavior 吗?我想检测我的 Qt 应用程序在高 dpi 屏幕上是否 运行,然后相应地设置缩放比例。
我试过设置在main
,which does not work
QProcessEnvironment::systemEnvironment().insert("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
It's meant to be used along with QProcess, to set the environment for child processes. It cannot be used to change the current process's environment.
跟进 Style sheets / Qt Designer support for high dpi screens?
以下应该有效
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");