aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qmltest
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-01-16 10:21:58 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-01-21 07:27:30 +0100
commit15ea475b40f6ad28d46e5cbd65a1ccc8556a53df (patch)
tree8156cc4a122f06d49623352c2fc6fbaf4e02b402 /tests/auto/qmltest
parent9aceff567c859bb91fe7221d2265953437402b43 (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 'tests/auto/qmltest')
-rw-r--r--tests/auto/qmltest/fontloader/daniel.ttfbin0 -> 51984 bytes
-rw-r--r--tests/auto/qmltest/fontloader/tst_fontloader.qml9
2 files changed, 2 insertions, 7 deletions
diff --git a/tests/auto/qmltest/fontloader/daniel.ttf b/tests/auto/qmltest/fontloader/daniel.ttf
new file mode 100644
index 0000000000..aae50d5035
--- /dev/null
+++ b/tests/auto/qmltest/fontloader/daniel.ttf
Binary files differ
diff --git a/tests/auto/qmltest/fontloader/tst_fontloader.qml b/tests/auto/qmltest/fontloader/tst_fontloader.qml
index 0d1831230e..48b92e02ba 100644
--- a/tests/auto/qmltest/fontloader/tst_fontloader.qml
+++ b/tests/auto/qmltest/fontloader/tst_fontloader.qml
@@ -81,10 +81,6 @@ Item {
fontloader.source = "dummy.ttf";
tryCompare(fontloader, 'status', FontLoader.Error)
compare(testinput.font.family, "")
- fontloader.source = "";
- fontloader.name = "Courier";
- tryCompare(fontloader, 'status', FontLoader.Ready)
- compare(testinput.font.family, "Courier")
}
function test_fontswitching() {
@@ -92,10 +88,9 @@ Item {
fontswitch.source = "tarzeau_ocr_a.ttf";
tryCompare(fontswitch, 'status', FontLoader.Ready)
compare(fontswitch.name, "OCRA")
- fontswitch.source = "";
- fontswitch.name = "Courier";
+ fontswitch.source = "daniel.ttf";
tryCompare(fontswitch, 'status', FontLoader.Ready)
- compare(fontswitch.name, "Courier")
+ compare(fontswitch.name, "Daniel")
fontswitch.source = "tarzeau_ocr_a.ttf";
tryCompare(fontswitch, 'status', FontLoader.Ready)
compare(fontswitch.name, "OCRA")