qt6-bb10/tests/auto/corelib
Friedemann Kleint ecb6327762 QTestLib: Introduce initMain() to run in main before qApp exists
When running Qt autotests on a developer machine with a high
resolution, failures occur due to either some widget becoming too
small, some rounding fuzz appearing when Qt High DPI scaling is active,
or some test taking screenshots failing to deal with device pixel
ratios != 1 in the obtained pixmaps.

It is not feasible to adapt all tests to pass on high resolution
monitors in both modes (Qt High DPI scaling enabled/disabled). It
should be possible to specify the High DPI setting per test.

Previously, it was not possible to set the Qt High DPI scaling
attributes since they must be applied before QApplication
instantiation.

Enable this by checking for the presence of a static void initMain()
function on the test object and invoking it before QApplication
instantiation.

Prototypically use it in tst_qtimer and to turn off High DPI scaling for
tst_QGL.

[ChangeLog][QtTestLib] It is now possible to perform static
initialization before QApplication instantiation by implementing a
initMain() function in the test class.

Change-Id: Idec0134b189710a14c41a451fa8445bc0c5b1cf3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-08-13 19:07:05 +02:00
..
animation unblacklist passing tests 2019-07-08 11:01:42 +00:00
codecs Port from QStringViewLiteral to u"" 2019-07-29 11:17:28 +03:00
global Conditionally disable parts of the tests testing the deprecated APIs 2019-08-01 13:51:18 +02:00
io Port from QStringViewLiteral to u"" 2019-07-29 11:17:28 +03:00
itemmodels test: migrate QItemSelectionModel test to QRegularExpression 2019-06-10 19:29:44 +00:00
kernel QTestLib: Introduce initMain() to run in main before qApp exists 2019-08-13 19:07:05 +02:00
mimetypes Remove handling of missing Q_COMPILER_RVALUE_REFS 2019-05-01 20:24:45 +00:00
plugin Merge remote-tracking branch 'origin/5.13' into dev 2019-07-05 15:37:50 +02:00
serialization Fix removal of QJsonObject properties when assigning undefined 2019-07-30 11:08:24 +02:00
statemachine test: migrate QStateMachine test to QRegularExpression 2019-06-10 19:23:42 +00:00
text Deprecate QStringViewLiteral 2019-08-10 22:13:49 +02:00
thread Remove the remaining usages of deprecated APIs of qtbase 2019-08-01 06:48:27 +02:00
time unblacklist passing tests 2019-07-08 11:01:42 +00:00
tools Merge remote-tracking branch 'origin/5.13' into dev 2019-08-13 09:46:17 +02:00
corelib.pro Move text-related code out of corelib/tools/ to corelib/text/ 2019-07-10 17:05:30 +02:00