aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktext/tst_qquicktext.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2016-03-04 12:13:09 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-01-21 07:27:49 +0100
commita43a0cf5e626c08868951096b8549d804192f79e (patch)
tree2002245ee344c9dd077e99152a7f3016427b562f /tests/auto/quick/qquicktext/tst_qquicktext.cpp
parent15ea475b40f6ad28d46e5cbd65a1ccc8556a53df (diff)
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 <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/quick/qquicktext/tst_qquicktext.cpp')
-rw-r--r--tests/auto/quick/qquicktext/tst_qquicktext.cpp2
1 files changed, 1 insertions, 1 deletions
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<QQuickText*>(textComponent.create());