diff options
Diffstat (limited to 'examples')
-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) | bin | 426 -> 426 bytes | |||
-rw-r--r-- | examples/declarative/progressbar/main.qml | 23 | ||||
-rw-r--r-- | examples/declarative/progressbar/progressbars.qml | 24 |
4 files changed, 28 insertions, 27 deletions
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 Binary files differindex 9044226..9044226 100644 --- a/examples/declarative/progressbar/images/lineedit-bg.png +++ b/examples/declarative/progressbar/content/background.png 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 } + } + } + } + } +} |