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 /src/quick/util/qquickfontloader.cpp | |
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 'src/quick/util/qquickfontloader.cpp')
-rw-r--r-- | src/quick/util/qquickfontloader.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/quick/util/qquickfontloader.cpp b/src/quick/util/qquickfontloader.cpp index 505c70df7c..addf8b0c18 100644 --- a/src/quick/util/qquickfontloader.cpp +++ b/src/quick/util/qquickfontloader.cpp @@ -310,6 +310,7 @@ void QQuickFontLoader::updateFontInfo(const QString& name, QQuickFontLoader::Sta /*! \qmlproperty string QtQuick::FontLoader::name + \readonly This property holds the name of the font family. It is set automatically when a font is loaded using the \l source property. @@ -338,17 +339,6 @@ QString QQuickFontLoader::name() const return d->name; } -void QQuickFontLoader::setName(const QString &name) -{ - Q_D(QQuickFontLoader); - if (d->name == name) - return; - d->name = name; - emit nameChanged(); - d->status = Ready; - emit statusChanged(); -} - /*! \qmlproperty enumeration QtQuick::FontLoader::status |