summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-07-23 11:41:06 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-07-24 12:36:15 +0200
commit999f62531a784b8f0f1f6d3cb7aaaa5455485d17 (patch)
treeacb6bdf06b6d006898832bde24aab7fe0020ed26
parent8361c6252fecf8b95cf06560f852b1e9b5c6b82b (diff)
testlib: Set AA_UseHighDpiPixmaps false for low-DPI tests
Change-Id: I129118c303527e4aff25c4d5326eefa43c231d44 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--mkspecs/features/testcase.prf2
-rw-r--r--src/testlib/qtest.h8
2 files changed, 10 insertions, 0 deletions
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 <typename T>