From 999f62531a784b8f0f1f6d3cb7aaaa5455485d17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 23 Jul 2020 11:41:06 +0200 Subject: [PATCH] testlib: Set AA_UseHighDpiPixmaps false for low-DPI tests Change-Id: I129118c303527e4aff25c4d5326eefa43c231d44 Reviewed-by: Volker Hilsheimer --- mkspecs/features/testcase.prf | 2 ++ src/testlib/qtest.h | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 83c9d574f4..c65237e5fe 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -22,6 +22,8 @@ testcase_lowdpi { } else { # TODO: Add support for other platforms if possible } + + DEFINES += TESTCASE_LOWDPI } benchmark: type = benchmark diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h index 0fbef0b7c2..cceefde84a 100644 --- a/src/testlib/qtest.h +++ b/src/testlib/qtest.h @@ -319,6 +319,14 @@ bool compareSequence(ActualIterator actualIt, ActualIterator actualEnd, return compare_helper(isOk, msg, nullptr, nullptr, actual, expected, file, line); } +#if defined(TESTCASE_LOWDPI) +void disableHighDpi() +{ + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, false); +} +Q_CONSTRUCTOR_FUNCTION(disableHighDpi); +#endif + } // namespace Internal template