diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-08-31 16:22:46 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-09-02 19:00:18 +0200 |
commit | 233b6534a79c09e30b9aeb14dbb1cb469a67f2a0 (patch) | |
tree | 432d8a06a3d11d8e21d68f6eb5b309a7aa73fac9 /src/gui | |
parent | b200ff685e40493c672dfe5f13988a812f1839ee (diff) |
High-DPI: Remove legacy environment variables
QT_DEVICE_PIXEL_RATIO is replaced by QT_SCALE_FACTOR, while
QT_AUTO_SCREEN_SCALE_FACTOR is replaced by QT_ENABLE_HIGHDPI_SCALING.
Since High-DPI is now always enabled, there's no reason to keep the
code path for android.app.auto_screen_scale_factor. Also, based on
the original commit message that introduced this code, the value of
the property should have been true.
Change-Id: Ib34b1deeab46c488c67c4d64f087599b4a54dc55
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qhighdpiscaling.cpp | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp index 023e19ad9c..53ecf8e0ad 100644 --- a/src/gui/kernel/qhighdpiscaling.cpp +++ b/src/gui/kernel/qhighdpiscaling.cpp @@ -55,11 +55,6 @@ QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcScaling, "qt.scaling"); #ifndef QT_NO_HIGHDPISCALING -static const char legacyDevicePixelEnvVar[] = "QT_DEVICE_PIXEL_RATIO"; - -// Note: QT_AUTO_SCREEN_SCALE_FACTOR is Done on X11, and should be kept -// working as-is. It's Deprecated on all other platforms. -static const char legacyAutoScreenEnvVar[] = "QT_AUTO_SCREEN_SCALE_FACTOR"; static const char enableHighDpiScalingEnvVar[] = "QT_ENABLE_HIGHDPI_SCALING"; static const char scaleFactorEnvVar[] = "QT_SCALE_FACTOR"; @@ -94,20 +89,8 @@ static inline qreal initialGlobalScaleFactor() qCDebug(lcScaling) << "Apply " << scaleFactorEnvVar << f; result = f; } - } else { - // Check for deprecated environment variables. - if (qEnvironmentVariableIsSet(legacyDevicePixelEnvVar)) { - qWarning("Warning: %s is deprecated. Instead use:\n" - " %s to enable platform plugin controlled per-screen factors.\n" - " %s to set per-screen DPI.\n" - " %s to set the application global scale factor.", - legacyDevicePixelEnvVar, legacyAutoScreenEnvVar, screenFactorsEnvVar, scaleFactorEnvVar); - - int dpr = qEnvironmentVariableIntValue(legacyDevicePixelEnvVar); - if (dpr > 0) - result = dpr; - } } + return result; } @@ -208,17 +191,6 @@ static inline qreal initialGlobalScaleFactor() factor based on display density information. These platforms include X11, Windows, and Android. - There is one API for enabling or disabling this behavior: - - The QT_AUTO_SCREEN_SCALE_FACTOR environment variable. - - Enabling either will make QHighDpiScaling call QPlatformScreen::pixelDensity() - and use the value provided as the scale factor for the screen in - question. Disabling is done on a 'veto' basis where either the - environment or the application can disable the scaling. The intended use - cases are 'My system is not providing correct display density - information' and 'My application needs to work in display pixels', - respectively. - The QT_SCREEN_SCALE_FACTORS environment variable can be used to set the screen scale factors manually. Set this to a semicolon-separated list of scale factors (matching the order of QGuiApplications::screens()), @@ -260,13 +232,8 @@ bool QHighDpiScaling::m_screenFactorSet = false; // QHighDpiScaling::setScreenFa static inline bool usePixelDensity() { // Determine if we should set a scale factor based on the pixel density - // reported by the platform plugin. There are several enablers and several - // disablers. A single disable may veto all other enablers. + // reported by the platform plugin. - bool screenEnvValueOk; - const int screenEnvValue = qEnvironmentVariableIntValue(legacyAutoScreenEnvVar, &screenEnvValueOk); - if (screenEnvValueOk && screenEnvValue < 1) - return false; bool enableEnvValueOk; const int enableEnvValue = qEnvironmentVariableIntValue(enableHighDpiScalingEnvVar, &enableEnvValueOk); if (enableEnvValueOk && enableEnvValue < 1) |