diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2016-03-04 12:13:09 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-01-21 07:27:49 +0100 |
commit | a43a0cf5e626c08868951096b8549d804192f79e (patch) | |
tree | 2002245ee344c9dd077e99152a7f3016427b562f /src/quick/items/qquicktext.cpp | |
parent | 15ea475b40f6ad28d46e5cbd65a1ccc8556a53df (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 'src/quick/items/qquicktext.cpp')
-rw-r--r-- | src/quick/items/qquicktext.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index 9493303314..2a6337cdb3 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -1465,11 +1465,10 @@ QQuickText::~QQuickText() */ /*! - \qmlproperty enumeration QtQuick::Text::font.weight + \qmlproperty int QtQuick::Text::font.weight - Sets the font's weight. - - The weight can be one of: + The requested weight of the font. The weight requested must be an integer + between 0 and 99, or one of the predefined values: \list \li Font.Thin \li Font.Light |