summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2009-11-25 01:34:42 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2009-11-25 01:34:42 (GMT)
commit93ca74ebc54db90416538c78df9f9cc1ea1b006e (patch)
tree12fa13ac5b2e30ea93b25d19b6737921ae8ca00d
parent0862302562b27811e3517412d0913dbbf573b646 (diff)
downloadQt-93ca74ebc54db90416538c78df9f9cc1ea1b006e.zip
Qt-93ca74ebc54db90416538c78df9f9cc1ea1b006e.tar.gz
Qt-93ca74ebc54db90416538c78df9f9cc1ea1b006e.tar.bz2
cleanup progressbar example
-rw-r--r--doc/src/declarative/example-slideswitch.qdoc2
-rw-r--r--examples/declarative/progressbar/content/ProgressBar.qml (renamed from examples/declarative/progressbar/ProgressBar.qml)8
-rw-r--r--examples/declarative/progressbar/content/background.png (renamed from examples/declarative/progressbar/images/lineedit-bg.png)bin426 -> 426 bytes
-rw-r--r--examples/declarative/progressbar/main.qml23
-rw-r--r--examples/declarative/progressbar/progressbars.qml24
5 files changed, 29 insertions, 28 deletions
diff --git a/doc/src/declarative/example-slideswitch.qdoc b/doc/src/declarative/example-slideswitch.qdoc
index c942918..a8376eb 100644
--- a/doc/src/declarative/example-slideswitch.qdoc
+++ b/doc/src/declarative/example-slideswitch.qdoc
@@ -127,7 +127,7 @@ For more information on scripts see \l{qmlecmascript.html}{ECMAScript Blocks}.
\snippet examples/declarative/slideswitch/content/Switch.qml 7
At this point, when the switch toggles between the two states the knob will instantly change its \c x position between 1 and 78.
-In order for the the knob to move smoothly we add a transistion that will animate the \c x property with an easing curve for a duration of 200ms.
+In order for the the knob to move smoothly we add a transition that will animate the \c x property with an easing curve for a duration of 200ms.
For more information on transitions see \l{state-transitions}{QML Transitions}.
diff --git a/examples/declarative/progressbar/ProgressBar.qml b/examples/declarative/progressbar/content/ProgressBar.qml
index 302caa9..bfc801c 100644
--- a/examples/declarative/progressbar/ProgressBar.qml
+++ b/examples/declarative/progressbar/content/ProgressBar.qml
@@ -11,17 +11,17 @@ Item {
property alias secondColor: g2.color
BorderImage {
- source: "images/lineedit-bg.png"
+ source: "background.png"
width: parent.width; height: parent.height
border.left: 4; border.top: 4; border.right: 4; border.bottom: 4
}
Rectangle {
- property int widthDest: (progressbar.width * (value - minimum)) / (maximum - minimum) - 6
- id: highlight; radius: 2
+ property int widthDest: ((progressbar.width * (value - minimum)) / (maximum - minimum) - 6)
+ id: highlight; radius: 1
anchors.left: parent.left; anchors.top: parent.top; anchors.bottom: parent.bottom
anchors.leftMargin: 3; anchors.topMargin: 3; anchors.bottomMargin: 3
- width: EaseFollow { source: highlight.widthDest; duration: 1000 }
+ width: EaseFollow { source: highlight.widthDest; velocity: 1200 }
gradient: Gradient {
GradientStop { id: g1; position: 0.0 }
GradientStop { id: g2; position: 1.0 }
diff --git a/examples/declarative/progressbar/images/lineedit-bg.png b/examples/declarative/progressbar/content/background.png
index 9044226..9044226 100644
--- a/examples/declarative/progressbar/images/lineedit-bg.png
+++ b/examples/declarative/progressbar/content/background.png
Binary files differ
diff --git a/examples/declarative/progressbar/main.qml b/examples/declarative/progressbar/main.qml
deleted file mode 100644
index 32353fc..0000000
--- a/examples/declarative/progressbar/main.qml
+++ /dev/null
@@ -1,23 +0,0 @@
-import Qt 4.6
-
-Rectangle {
- id: main
- width: 800; height: 580; color: "#edecec"
-
- Flickable {
- anchors.fill: parent; viewportHeight: column.height
- Column {
- id: column; spacing: 4
- Repeater {
- model: 50
- ProgressBar {
- property int r: Math.floor(Math.random() * 4000 + 1000)
- width: main.width
- value: NumberAnimation { duration: r; from: 0; to: 100; running: true; repeat: true }
- color: ColorAnimation { duration: r; from: "lightsteelblue"; to: "thistle"; running: true; repeat: true }
- secondColor: ColorAnimation { duration: r; from: "steelblue"; to: "#CD96CD"; running: true; repeat: true }
- }
- }
- }
- }
-}
diff --git a/examples/declarative/progressbar/progressbars.qml b/examples/declarative/progressbar/progressbars.qml
new file mode 100644
index 0000000..6de8ecf
--- /dev/null
+++ b/examples/declarative/progressbar/progressbars.qml
@@ -0,0 +1,24 @@
+import Qt 4.6
+import "content"
+
+Rectangle {
+ id: main
+ width: 600; height: 405; color: "#edecec"
+
+ Flickable {
+ anchors.fill: parent; viewportHeight: column.height + 20
+ Column {
+ id: column; x: 10; y: 10; spacing: 10
+ Repeater {
+ model: 25
+ ProgressBar {
+ property int r: Math.floor(Math.random() * 5000 + 1000)
+ width: main.width - 20
+ value: NumberAnimation { duration: r; from: 0; to: 100; running: true; repeat: true }
+ color: ColorAnimation { duration: r; from: "lightsteelblue"; to: "thistle"; running: true; repeat: true }
+ secondColor: ColorAnimation { duration: r; from: "steelblue"; to: "#CD96CD"; running: true; repeat: true }
+ }
+ }
+ }
+ }
+}