summaryrefslogtreecommitdiffstats
path: root/tests/manual/highdpi/dprgadget/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/highdpi/dprgadget/main.cpp')
-rw-r--r--tests/manual/highdpi/dprgadget/main.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/manual/highdpi/dprgadget/main.cpp b/tests/manual/highdpi/dprgadget/main.cpp
index 78189e8a39..26a653e849 100644
--- a/tests/manual/highdpi/dprgadget/main.cpp
+++ b/tests/manual/highdpi/dprgadget/main.cpp
@@ -1,6 +1,7 @@
// Copyright (C) 2020 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+#include <QtCore/qtversion.h>
#include <QtGui/qpa/qplatformscreen.h>
#include <QtGui/qpa/qplatformwindow.h>
#include <QtGui/private/qhighdpiscaling_p.h>
@@ -22,6 +23,7 @@ bool g_qtScaleFactor = false;
bool g_qtUsePhysicalDpi = false;
bool g_qtFontDpi = false;
bool g_qtScaleFactorRoundingPolicy = false;
+bool g_qtHighDpiDownscale = false;
bool g_displayEvents = false;
@@ -136,7 +138,7 @@ public:
if (g_displayEvents)
layout->addWidget(eventsLabel);
- bool activeEnvironment = g_qtScaleFactor || g_qtUsePhysicalDpi || g_qtFontDpi || g_qtScaleFactorRoundingPolicy;
+ bool activeEnvironment = g_qtScaleFactor || g_qtUsePhysicalDpi || g_qtFontDpi || g_qtScaleFactorRoundingPolicy || g_qtHighDpiDownscale;
if (activeEnvironment) {
layout->addWidget(new QLabel("Active Environment:"));
if (g_qtScaleFactor) {
@@ -155,7 +157,10 @@ public:
QString text = QString("QT_SCALE_FACTOR_ROUNDING_POLICY=") + qgetenv("QT_SCALE_FACTOR_ROUNDING_POLICY");
layout->addWidget(new QLabel(text));
}
-
+ if (g_qtHighDpiDownscale) {
+ QString text = QString("QT_WIDGETS_HIGHDPI_DOWNSCALE=") + qgetenv("QT_WIDGETS_HIGHDPI_DOWNSCALE");
+ layout->addWidget(new QLabel(text));
+ }
}
auto updateValues = [=]() {
@@ -244,6 +249,7 @@ int main(int argc, char **argv) {
g_qtUsePhysicalDpi = qgetenv("QT_USE_PHYSICAL_DPI") == QByteArray("1");
g_qtFontDpi = qEnvironmentVariableIsSet("QT_FONT_DPI");
g_qtScaleFactorRoundingPolicy = qEnvironmentVariableIsSet("QT_SCALE_FACTOR_ROUNDING_POLICY");
+ g_qtHighDpiDownscale = qEnvironmentVariableIsSet("QT_WIDGETS_HIGHDPI_DOWNSCALE");
QApplication app(argc, argv);