aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@qt.io>2023-12-08 12:42:12 +0000
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-12-29 04:30:56 +0000
commit682518e18bb7e7735dd948fcc32633f80c2d9b72 (patch)
tree7df83a2aad035aa04a1c3cd358b104d06a8e307b
parent29862ca7d8377cd6ba129d1bda03109ded954588 (diff)
Doc: Add an example customization for an indeterminate ProgressBar
The indeterminate state for a ProgressBar control was not mentioned in the customization documentation. Adapt an animation from the old Qt Quick Controls 1 customization and link to the indeterminate property documentation. Fixes: QTBUG-116306 Pick-to: 6.5 Change-Id: I56d2c7fe4b326637806edd85d40be040b7fdb3f6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 57f5f462fcd6ed48fab49041d82edd65cf9138c5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 38f167d3c6ac3cbdc721e9c854a2fc6ab619b31a)
-rw-r--r--src/quickcontrols/doc/snippets/qtquickcontrols-progressbar-custom.qml29
-rw-r--r--src/quickcontrols/doc/src/qtquickcontrols-customize.qdoc3
2 files changed, 32 insertions, 0 deletions
diff --git a/src/quickcontrols/doc/snippets/qtquickcontrols-progressbar-custom.qml b/src/quickcontrols/doc/snippets/qtquickcontrols-progressbar-custom.qml
index 7158232081..a961debd44 100644
--- a/src/quickcontrols/doc/snippets/qtquickcontrols-progressbar-custom.qml
+++ b/src/quickcontrols/doc/snippets/qtquickcontrols-progressbar-custom.qml
@@ -21,11 +21,40 @@ ProgressBar {
implicitWidth: 200
implicitHeight: 4
+ // Progress indicator for determinate state.
Rectangle {
width: control.visualPosition * parent.width
height: parent.height
radius: 2
color: "#17a81a"
+ visible: !control.indeterminate
+ }
+
+ // Scrolling animation for indeterminate state.
+ Item {
+ anchors.fill: parent
+ visible: control.indeterminate
+ clip: true
+
+ Row {
+ spacing: 20
+
+ Repeater {
+ model: control.width / 40 + 1
+
+ Rectangle {
+ color: "#17a81a"
+ width: 20
+ height: control.height
+ }
+ }
+ XAnimator on x {
+ from: 0
+ to: -40
+ loops: Animation.Infinite
+ running: control.indeterminate
+ }
+ }
}
}
}
diff --git a/src/quickcontrols/doc/src/qtquickcontrols-customize.qdoc b/src/quickcontrols/doc/src/qtquickcontrols-customize.qdoc
index adc97177c8..0a76f0eb4c 100644
--- a/src/quickcontrols/doc/src/qtquickcontrols-customize.qdoc
+++ b/src/quickcontrols/doc/src/qtquickcontrols-customize.qdoc
@@ -761,6 +761,9 @@
\snippet qtquickcontrols-progressbar-custom.qml file
+ Above, the content item is also animated to represent an
+ \l {ProgressBar::}{indeterminate} progress bar state.
+
\section2 Customizing RadioButton