summaryrefslogtreecommitdiffstats
path: root/tests/manual/highdpi/dprgadget
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/highdpi/dprgadget')
-rw-r--r--tests/manual/highdpi/dprgadget/CMakeLists.txt27
-rw-r--r--tests/manual/highdpi/dprgadget/main.cpp12
2 files changed, 20 insertions, 19 deletions
diff --git a/tests/manual/highdpi/dprgadget/CMakeLists.txt b/tests/manual/highdpi/dprgadget/CMakeLists.txt
index a8d52f03d8..2c6bd91f0d 100644
--- a/tests/manual/highdpi/dprgadget/CMakeLists.txt
+++ b/tests/manual/highdpi/dprgadget/CMakeLists.txt
@@ -1,18 +1,13 @@
-# special case skip regeneration
-cmake_minimum_required(VERSION 3.16)
-project(dprgadget LANGUAGES CXX)
-set(CMAKE_AUTOMOC ON)
-find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets)
-
-qt_add_executable(dprgadget
- main.cpp
-)
-
-target_link_libraries(dprgadget PUBLIC
- Qt::Core
- Qt::Gui
- Qt::GuiPrivate
- Qt::Widgets
+#####################################################################
+## dprgadget Binary:
+#####################################################################
+
+qt_internal_add_manual_test(dprgadget
+ SOURCES
+ main.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::Widgets
+ Qt::GuiPrivate
)
-
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);