diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-01-16 10:21:58 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2020-01-21 07:27:30 +0100 |
commit | 15ea475b40f6ad28d46e5cbd65a1ccc8556a53df (patch) | |
tree | 8156cc4a122f06d49623352c2fc6fbaf4e02b402 /examples/quick/text/fonts/fonts.qml | |
parent | 9aceff567c859bb91fe7221d2265953437402b43 (diff) |
Make FontLoader.name read-only
Being able to set the name of a FontLoader seems to have been made to
allow for some alternative coding patterns, but it doesn't really
provide any convenience over other ways of customizing font names,
and it definitely adds confusion for users, as well as as a possible
race condition if both the source and name of the same FontLoader is
set at unpredictable times.
[ChangeLog][QtQuick] FontLoader.name property has been made read-only
to reduce confusion about its use and precedence over conflicting
properties.
Fixes: QTBUG-80031
Change-Id: I0dd0e76ff376402c0b458ed7e5c57ec017bbc92d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'examples/quick/text/fonts/fonts.qml')
-rw-r--r-- | examples/quick/text/fonts/fonts.qml | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/examples/quick/text/fonts/fonts.qml b/examples/quick/text/fonts/fonts.qml index d356e00417..f4e721b6c1 100644 --- a/examples/quick/text/fonts/fonts.qml +++ b/examples/quick/text/fonts/fonts.qml @@ -56,9 +56,6 @@ Rectangle { width: 320; height: 480 color: "steelblue" -//! [fontloader] - FontLoader { id: fixedFont; name: "Courier" } -//! [fontloader] //! [fontloaderlocal] FontLoader { id: localFont; source: "content/fonts/tarzeau_ocr_a.ttf" } //! [fontloaderlocal] @@ -94,14 +91,14 @@ Rectangle { width: parent.width horizontalAlignment: Text.AlignRight wrapMode: Text.WordWrap - font { family: fixedFont.name; pixelSize: 20; weight: Font.Bold; capitalization: Font.AllLowercase } + font { family: "Courier"; pixelSize: 20; weight: Font.Bold; capitalization: Font.AllLowercase } } Text { text: myText color: "lightsteelblue" width: parent.width wrapMode: Text.WordWrap - font { family: fixedFont.name; pixelSize: 20; italic: true; capitalization: Font.SmallCaps } + font { family: "Courier"; pixelSize: 20; italic: true; capitalization: Font.SmallCaps } } Text { text: myText |