diff options
Diffstat (limited to 'examples/quick/text/fonts')
-rw-r--r-- | examples/quick/text/fonts/availableFonts.qml | 5 | ||||
-rw-r--r-- | examples/quick/text/fonts/fonts.qml | 13 |
2 files changed, 10 insertions, 8 deletions
diff --git a/examples/quick/text/fonts/availableFonts.qml b/examples/quick/text/fonts/availableFonts.qml index ea3bff22b8..41dbae0021 100644 --- a/examples/quick/text/fonts/availableFonts.qml +++ b/examples/quick/text/fonts/availableFonts.qml @@ -61,11 +61,12 @@ Rectangle { delegate: Item { height: 40; width: ListView.view.width + required property string modelData Text { anchors.centerIn: parent - text: modelData + text: parent.modelData //! [delegate] - font.family: modelData + font.family: parent.modelData //! [delegate] font.pixelSize: 20 color: "white" diff --git a/examples/quick/text/fonts/fonts.qml b/examples/quick/text/fonts/fonts.qml index f4e721b6c1..aeb17c48e2 100644 --- a/examples/quick/text/fonts/fonts.qml +++ b/examples/quick/text/fonts/fonts.qml @@ -51,6 +51,7 @@ import QtQuick 2.0 Rectangle { + id: root property string myText: "The quick brown fox jumps over the lazy dog." width: 320; height: 480 @@ -68,7 +69,7 @@ Rectangle { spacing: 15 Text { - text: myText + text: root.myText color: "lightsteelblue" width: parent.width wrapMode: Text.WordWrap @@ -78,7 +79,7 @@ Rectangle { font.pixelSize: 20 } Text { - text: myText + text: root.myText color: "lightsteelblue" width: parent.width wrapMode: Text.WordWrap @@ -86,7 +87,7 @@ Rectangle { font { family: "Times"; pixelSize: 20; capitalization: Font.AllUppercase } } Text { - text: myText + text: root.myText color: "lightsteelblue" width: parent.width horizontalAlignment: Text.AlignRight @@ -94,14 +95,14 @@ Rectangle { font { family: "Courier"; pixelSize: 20; weight: Font.Bold; capitalization: Font.AllLowercase } } Text { - text: myText + text: root.myText color: "lightsteelblue" width: parent.width wrapMode: Text.WordWrap font { family: "Courier"; pixelSize: 20; italic: true; capitalization: Font.SmallCaps } } Text { - text: myText + text: root.myText color: "lightsteelblue" width: parent.width wrapMode: Text.WordWrap @@ -109,7 +110,7 @@ Rectangle { } Text { text: { - if (webFont.status == FontLoader.Ready) myText + if (webFont.status == FontLoader.Ready) root.myText else if (webFont.status == FontLoader.Loading) "Loading..." else if (webFont.status == FontLoader.Error) "Error loading font" } |