aboutsummaryrefslogtreecommitdiffstats
path: root/src/app
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@qt.io>2023-06-13 18:00:36 +0200
committerCristian Adam <cristian.adam@qt.io>2023-06-14 11:48:54 +0000
commit12e04105f5d7565d6a5e46c6faa0b50d78ab65b9 (patch)
treea68dd8ff22dca638b313bf3956da7290689a71a5 /src/app
parentaba966e3eeba03b3263c0316e24bd28d868bef1d (diff)
App: Allow overriding of QT_SCALE_FACTOR_ROUNDING_POLICY
The current code sets Qt::HighDpiScaleFactorRoundingPolicy::Floor with no option to override the value to something else. Change-Id: Id08a1cf8165f44a759c9ce8016a1173eb38f5a8d Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'src/app')
-rw-r--r--src/app/main.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/app/main.cpp b/src/app/main.cpp
index e6a7bdcd7e..9e1e745880 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -278,7 +278,6 @@ static Utils::QtcSettings *createUserSettings()
static void setHighDpiEnvironmentVariable()
{
-
if (Utils::HostOsInfo::isMacHost())
return;
@@ -293,10 +292,12 @@ static void setHighDpiEnvironmentVariable()
&& !qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR")
&& !qEnvironmentVariableIsSet("QT_SCALE_FACTOR")
&& !qEnvironmentVariableIsSet("QT_SCREEN_SCALE_FACTORS")) {
- } else {
+ return;
+ }
+
+ if (!qEnvironmentVariableIsSet("QT_SCALE_FACTOR_ROUNDING_POLICY"))
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::Floor);
- }
}
void setPixmapCacheLimit()