[Development] Fonts in QtWidgets and QtQuick
Alberto Mardegan
mardy at users.sourceforge.net
Tue Nov 27 22:18:01 CET 2018
On 26/11/18 00:46, Alberto Mardegan wrote:
> I'm working on a desktop style for the QtQuick Controls 2 API [1], and
> as I'm trying to achieve a pixel-by-pixel equivalence with QtWidgets,
> I'm writing unit tests which graphically compare the output generated by
> my controls versus that generated by QtWidgets.
Guess what? The font difference is due to the Qt::AA_Use96Dpi flag that
is set on the QApplication by the QTEST_MAIN() macro.
It looks like this flag is not properly handled by all code paths, so
setting it affects QtQuick's font rendering but not QtWidget's.
Anyway, setting this flag to `false` at the beginning of my tests seems
to fix the issue.
Ciao,
Alberto
--
http://blog.mardy.it - Geek in un lingua international
More information about the Development
mailing list