summaryrefslogtreecommitdiffstats
path: root/examples/declarative/fonts
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/fonts')
-rw-r--r--examples/declarative/fonts/availableFonts.qml17
-rw-r--r--examples/declarative/fonts/fonts.qml6
-rw-r--r--examples/declarative/fonts/hello.qml2
3 files changed, 21 insertions, 4 deletions
diff --git a/examples/declarative/fonts/availableFonts.qml b/examples/declarative/fonts/availableFonts.qml
new file mode 100644
index 0000000..defa4ce
--- /dev/null
+++ b/examples/declarative/fonts/availableFonts.qml
@@ -0,0 +1,17 @@
+import Qt 4.7
+
+Rectangle {
+ width: 480; height: 640; color: "steelblue"
+
+ ListView {
+ anchors.fill: parent; model: Qt.fontFamilies()
+
+ delegate: Item {
+ height: 40; width: ListView.view.width
+ Text {
+ anchors.centerIn: parent
+ text: modelData; font.family: modelData; font.pixelSize: 24; color: "white"
+ }
+ }
+ }
+}
diff --git a/examples/declarative/fonts/fonts.qml b/examples/declarative/fonts/fonts.qml
index ae31b03..f3eac48 100644
--- a/examples/declarative/fonts/fonts.qml
+++ b/examples/declarative/fonts/fonts.qml
@@ -51,9 +51,9 @@ Rectangle {
}
Text {
text: {
- if (webFont.status == 1) myText
- else if (webFont.status == 2) "Loading..."
- else if (webFont.status == 3) "Error loading font"
+ if (webFont.status == FontLoader.Ready) myText
+ else if (webFont.status == FontLoader.Loading) "Loading..."
+ else if (webFont.status == FontLoader.Error) "Error loading font"
}
color: "lightsteelblue"
width: parent.width
diff --git a/examples/declarative/fonts/hello.qml b/examples/declarative/fonts/hello.qml
index d4d0e4c..0d6f4cd 100644
--- a/examples/declarative/fonts/hello.qml
+++ b/examples/declarative/fonts/hello.qml
@@ -19,7 +19,7 @@ Rectangle {
SequentialAnimation on font.letterSpacing {
loops: Animation.Infinite;
- NumberAnimation { from: 100; to: 300; easing.type: "InQuad"; duration: 3000 }
+ NumberAnimation { from: 100; to: 300; easing.type: Easing.InQuad; duration: 3000 }
ScriptAction {
script: {
container.y = (screen.height / 4) + (Math.random() * screen.height / 2)