From a43a0cf5e626c08868951096b8549d804192f79e Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 4 Mar 2016 12:13:09 +0100 Subject: Make Font.weight an integer instead of enumeration The weight in QFont is an integer, allowing you to request a font of any weight given the predefined scale. In Qt Quick, however, you were limited to the predefined values. This is done in Qt 6 because it breaks conversions from string to weight, as the change in the autotest illustrates. [ChangeLog][Font] Made Font.weight an integer value rather than limit it to a predefined set of weights. As a side effect, conversion from strings to font weights are no longer supported. Fixes: QTBUG-80402 Change-Id: Ifbe9a0e608b63bfa93bb54999b0b3c1851ccfa88 Reviewed-by: Ulf Hermann Reviewed-by: Fabian Kosmale Reviewed-by: Simon Hausmann --- tests/auto/quick/qquicktext/tst_qquicktext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/quick/qquicktext/tst_qquicktext.cpp') diff --git a/tests/auto/quick/qquicktext/tst_qquicktext.cpp b/tests/auto/quick/qquicktext/tst_qquicktext.cpp index a64c9372da..19a33f1861 100644 --- a/tests/auto/quick/qquicktext/tst_qquicktext.cpp +++ b/tests/auto/quick/qquicktext/tst_qquicktext.cpp @@ -1506,7 +1506,7 @@ void tst_qquicktext::weight() delete textObject; } { - QString componentStr = "import QtQuick 2.0\nText { font.weight: \"Bold\"; text: \"Hello world!\" }"; + QString componentStr = "import QtQuick 2.0\nText { font.weight: Font.Bold; text: \"Hello world!\" }"; QQmlComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QQuickText *textObject = qobject_cast(textComponent.create()); -- cgit v1.2.3