Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
None
-
5.12.0
-
None
Description
While trying to run tst_QStaticText locally on windows I get a lot of failing tests (drawToPoint, scaledPainter, transformationChanged and others).
After some investigation I found out that QStaticText is using 120dpi for the font but QPainter::drawText() on a QPixmap is using 96dpi. The 96dpi are coming from Qt::AA_Use96Dpi which will be inside QTEST_MAIN macro. This attribute is correctly honored by QStyleHelper::dpi()/dpiScaled() and qt_defaultDpiX()/qt_defaultDpiY() but not for QWindowsFontDatabase::defaultVerticalDPI() which then causes the tests to fail.
Looks like the CI is also using 96dpi - otherwise those tests must fail there too.
Now there are two options
- fix QWindowsFontDatabase::defaultVerticalDPI()
- remove Qt::AA_Use96Dpi in Qt6
I'm for the latter but don't know if this attribute is used elsewhere outside the unittests.
See also https://codereview.qt-project.org/c/qt/qtbase/+/256847