testlib: Set AA_UseHighDpiPixmaps false for low-DPI tests

Change-Id: I129118c303527e4aff25c4d5326eefa43c231d44
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Tor Arne Vestbø 2020-07-23 11:41:06 +02:00
parent 8361c6252f
commit 999f62531a
2 changed files with 10 additions and 0 deletions

View File

@ -22,6 +22,8 @@ testcase_lowdpi {
} else {
# TODO: Add support for other platforms if possible
}
DEFINES += TESTCASE_LOWDPI
}
benchmark: type = benchmark

View File

@ -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>