summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-03-05 01:18:53 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2010-03-05 01:18:53 (GMT)
commit24a94c1b88fc72243c53e1bf51b87dc0d0be41b7 (patch)
tree01d20c577044a351950814a6fda873d489d78bf2 /examples
parent38ff49e632da2bd61ac5fb59f57f62208c2687fd (diff)
downloadQt-24a94c1b88fc72243c53e1bf51b87dc0d0be41b7.zip
Qt-24a94c1b88fc72243c53e1bf51b87dc0d0be41b7.tar.gz
Qt-24a94c1b88fc72243c53e1bf51b87dc0d0be41b7.tar.bz2
declarative examples cleanup
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/behaviours/MyRect.qml13
-rw-r--r--examples/declarative/fonts/fonts.qml13
-rw-r--r--examples/declarative/listview/itemlist.qml8
-rw-r--r--examples/declarative/mousearea/mouse.qml (renamed from examples/declarative/mouseregion/mouse.qml)0
-rw-r--r--examples/declarative/plugins/com/nokia/TimeExample/Clock.qml8
-rw-r--r--examples/declarative/searchbox/main.qml6
-rw-r--r--examples/declarative/velocity/Day.qml4
7 files changed, 12 insertions, 40 deletions
diff --git a/examples/declarative/behaviours/MyRect.qml b/examples/declarative/behaviours/MyRect.qml
deleted file mode 100644
index caf0d83..0000000
--- a/examples/declarative/behaviours/MyRect.qml
+++ /dev/null
@@ -1,13 +0,0 @@
-import Qt 4.6
-
-Rectangle {
- radius: 15
- border.color: "black"
- width: 100
- height: 100
- id: page
- MouseArea {
- anchors.fill: parent
- onClicked: { bluerect.parent = page; bluerect.x=0 }
- }
-}
diff --git a/examples/declarative/fonts/fonts.qml b/examples/declarative/fonts/fonts.qml
index 275ad43..6246d16 100644
--- a/examples/declarative/fonts/fonts.qml
+++ b/examples/declarative/fonts/fonts.qml
@@ -7,11 +7,8 @@ Rectangle {
color: "steelblue"
FontLoader { id: fixedFont; name: "Courier" }
-
FontLoader { id: localFont; source: "fonts/tarzenau-ocr-a.ttf" }
-
FontLoader { id: webFont; source: "http://www.princexml.com/fonts/steffmann/Starburst.ttf" }
- FontLoader { id: webFont2; source: "http://wrong.address.org" }
Column {
anchors.fill: parent; spacing: 10
@@ -55,15 +52,5 @@ Rectangle {
width: parent.width; elide: Text.ElideMiddle
font.family: webFont.name; font.pointSize: 36
}
- Text {
- text: {
- if (webFont2.status == 1) myText
- else if (webFont2.status == 2) "Loading..."
- else if (webFont2.status == 3) "Error loading font"
- }
- color: "lightsteelblue"
- width: parent.width; elide: Text.ElideRight
- font.family: webFont2.name; font.pointSize: 36
- }
}
}
diff --git a/examples/declarative/listview/itemlist.qml b/examples/declarative/listview/itemlist.qml
index 54981b7..41aa860 100644
--- a/examples/declarative/listview/itemlist.qml
+++ b/examples/declarative/listview/itemlist.qml
@@ -26,14 +26,12 @@ Rectangle {
ListView {
id: view
- anchors.fill: parent
- anchors.bottomMargin: 30
+ anchors.fill: parent; anchors.bottomMargin: 30
model: itemModel
- preferredHighlightBegin: 0
- preferredHighlightEnd: 0
+ preferredHighlightBegin: 0; preferredHighlightEnd: 0
highlightRangeMode: "StrictlyEnforceRange"
orientation: ListView.Horizontal
- flickDeceleration: 2000
+ snapMode: ListView.SnapOneItem; flickDeceleration: 2000
}
Rectangle {
diff --git a/examples/declarative/mouseregion/mouse.qml b/examples/declarative/mousearea/mouse.qml
index 9191f8a..9191f8a 100644
--- a/examples/declarative/mouseregion/mouse.qml
+++ b/examples/declarative/mousearea/mouse.qml
diff --git a/examples/declarative/plugins/com/nokia/TimeExample/Clock.qml b/examples/declarative/plugins/com/nokia/TimeExample/Clock.qml
index 01ec686..622fcf9 100644
--- a/examples/declarative/plugins/com/nokia/TimeExample/Clock.qml
+++ b/examples/declarative/plugins/com/nokia/TimeExample/Clock.qml
@@ -1,8 +1,8 @@
import Qt 4.6
-Item {
+Rectangle {
id: clock
- width: 200; height: 200
+ width: 200; height: 200; color: "gray"
property alias city: cityLabel.text
property var hours
@@ -18,7 +18,7 @@ Item {
transform: Rotation {
id: hourRotation
origin.x: 7.5; origin.y: 73; angle: 0
- angle: SpringFollow {
+ SpringFollow on angle {
spring: 2; damping: 0.2; modulus: 360
source: (clock.hours * 30) + (clock.minutes * 0.5)
}
@@ -32,7 +32,7 @@ Item {
transform: Rotation {
id: minuteRotation
origin.x: 6.5; origin.y: 83; angle: 0
- angle: SpringFollow {
+ SpringFollow on angle {
spring: 2; damping: 0.2; modulus: 360
source: clock.minutes * 6
}
diff --git a/examples/declarative/searchbox/main.qml b/examples/declarative/searchbox/main.qml
index 39c3720..9b33be3 100644
--- a/examples/declarative/searchbox/main.qml
+++ b/examples/declarative/searchbox/main.qml
@@ -6,8 +6,8 @@ Rectangle {
Column {
anchors.horizontalCenter: parent.horizontalCenter; anchors.verticalCenter: parent.verticalCenter; spacing: 10
- SearchBox { id: search1; KeyNavigation.down: search2; focus: true }
- SearchBox { id: search2; KeyNavigation.up: search1; KeyNavigation.down: search3 }
- SearchBox { id: search3; KeyNavigation.up: search2 }
+ SearchBox { id: search1; KeyNavigation.tab: search2; KeyNavigation.backtab: search3; focus: true }
+ SearchBox { id: search2; KeyNavigation.tab: search3; KeyNavigation.backtab: search1 }
+ SearchBox { id: search3; KeyNavigation.tab: search1; KeyNavigation.backtab: search2 }
}
}
diff --git a/examples/declarative/velocity/Day.qml b/examples/declarative/velocity/Day.qml
index 7424f60..8a7364e 100644
--- a/examples/declarative/velocity/Day.qml
+++ b/examples/declarative/velocity/Day.qml
@@ -33,7 +33,7 @@ Rectangle {
id: sticky
scale: 0.5
Image {
- id: stickyImage; source: "sticky.png"
+ id: stickyImage; source: "sticky.png"; transformOrigin: Item.TopLeft
smooth: true; y: -20; x: 8 + -width * 0.6 / 2; scale: 0.6
}
@@ -59,7 +59,7 @@ Rectangle {
}
Image {
- source: "tack.png"
+ source: "tack.png"; transformOrigin: Item.TopLeft
x: -width / 2; y: -height * 0.7 / 2; scale: 0.7
}