From 1d14067680f02f47b2f8ff375c44eb64633eec02 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 18 Nov 2020 13:45:19 +0100 Subject: Fix weight when reading old serialized QFonts The QFont::fromString() needs to differ between strings produced before and after Qt 6.0 when interpreting the weight value, since in older strings this will be the legacy scale. Luckily the number of tokens in the string can be used for this purpose, since many tokens were added in Qt 6.0. This broke KDE, where font settings are stored in QSettings and serialized using QFont::toString() from Qt 5. Fixes: QTBUG-88589 Pick-to: 6.0.0 6.0 Change-Id: I199737fed61917f8b9d8f86176ead29a89eb8e0c Reviewed-by: Andy Shaw --- tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/gui/kernel') diff --git a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp index 5a01263d80..9ef5ce75bf 100644 --- a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp +++ b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp @@ -334,7 +334,7 @@ void tst_QGuiVariant::toFont_data() QTest::addColumn("result"); QFont f("times",12,-1,false); - QTest::newRow( "string" ) << QVariant( QString( "times,12,-1,5,400,0,0,0,0,0" ) ) << f; + QTest::newRow( "string" ) << QVariant( QString( "times,12,-1,5,50,0,0,0,0,0" ) ) << f; } void tst_QGuiVariant::toFont() -- cgit v1.2.3