summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2014-03-18 13:15:16 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-18 19:16:53 +0100
commit241ffae4518159caa812d594c2702ac16e0c8f29 (patch)
tree33a55812fe4fa0b17419db3054e4716dccee17a6
parentb4218a05599f6968634f868351ca08c63eeca89a (diff)
downloadqtquickcontrols-241ffae4518159caa812d594c2702ac16e0c8f29.tar.gz
Add example for indeterminate progress bar animation
While this is not really a bug fix it was not documented how you could create your own animated progress bar. Task-number: QTBUG-37434 Change-Id: I5419c2f886c98189207f4e2682e8dda8206677ee Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
-rw-r--r--src/controls/Styles/Base/ProgressBarStyle.qml36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/controls/Styles/Base/ProgressBarStyle.qml b/src/controls/Styles/Base/ProgressBarStyle.qml
index d8ff8140..d0fa9a35 100644
--- a/src/controls/Styles/Base/ProgressBarStyle.qml
+++ b/src/controls/Styles/Base/ProgressBarStyle.qml
@@ -70,6 +70,42 @@ import QtQuick.Controls.Private 1.0
}
}
\endqml
+
+ Note that the example above is somewhat simplified and will not animate
+ an indeterminate progress bar. The following snippet demonstrates
+ how you can incorporate a custom animation for the indeterminate
+ state as well.
+
+ \code
+ progress: Rectangle {
+ border.color: "steelblue"
+ color: "lightsteelblue"
+
+ // Indeterminate animation by animating alternating stripes:
+ Item {
+ anchors.fill: parent
+ anchors.margins: 1
+ visible: control.indeterminate
+ clip: true
+ Row {
+ Repeater {
+ Rectangle {
+ color: index % 2 ? "steelblue" : "lightsteelblue"
+ width: 20 ; height: control.height
+ }
+ model: control.width / 20 + 2
+ }
+ XAnimator on x {
+ from: 0 ; to: -40
+ loops: Animation.Infinite
+ running: control.indeterminate
+ }
+ }
+ }
+ }
+ \endcode
+
+
*/
Style {