aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/controls/doc/images/qtquickcontrols2-progressbar-background.pngbin0 -> 116 bytes
-rw-r--r--src/controls/doc/images/qtquickcontrols2-progressbar-disabled.pngbin0 -> 320 bytes
-rw-r--r--src/controls/doc/images/qtquickcontrols2-progressbar-indicator.pngbin0 -> 286 bytes
-rw-r--r--src/controls/doc/images/qtquickcontrols2-progressbar-normal.pngbin0 -> 322 bytes
-rw-r--r--src/controls/doc/src/qtquickcontrols2-customize.qdoc18
-rw-r--r--src/controls/qquickprogressbar.cpp39
-rw-r--r--src/imports/controls/ProgressBar.qml4
7 files changed, 55 insertions, 6 deletions
diff --git a/src/controls/doc/images/qtquickcontrols2-progressbar-background.png b/src/controls/doc/images/qtquickcontrols2-progressbar-background.png
new file mode 100644
index 00000000..82070b8c
--- /dev/null
+++ b/src/controls/doc/images/qtquickcontrols2-progressbar-background.png
Binary files differ
diff --git a/src/controls/doc/images/qtquickcontrols2-progressbar-disabled.png b/src/controls/doc/images/qtquickcontrols2-progressbar-disabled.png
new file mode 100644
index 00000000..4baf5c83
--- /dev/null
+++ b/src/controls/doc/images/qtquickcontrols2-progressbar-disabled.png
Binary files differ
diff --git a/src/controls/doc/images/qtquickcontrols2-progressbar-indicator.png b/src/controls/doc/images/qtquickcontrols2-progressbar-indicator.png
new file mode 100644
index 00000000..02e888ed
--- /dev/null
+++ b/src/controls/doc/images/qtquickcontrols2-progressbar-indicator.png
Binary files differ
diff --git a/src/controls/doc/images/qtquickcontrols2-progressbar-normal.png b/src/controls/doc/images/qtquickcontrols2-progressbar-normal.png
new file mode 100644
index 00000000..783d721d
--- /dev/null
+++ b/src/controls/doc/images/qtquickcontrols2-progressbar-normal.png
Binary files differ
diff --git a/src/controls/doc/src/qtquickcontrols2-customize.qdoc b/src/controls/doc/src/qtquickcontrols2-customize.qdoc
index 7bbd0d71..a89c8d69 100644
--- a/src/controls/doc/src/qtquickcontrols2-customize.qdoc
+++ b/src/controls/doc/src/qtquickcontrols2-customize.qdoc
@@ -78,6 +78,24 @@
\snippet CheckBox.qml indicator
+ \section1 Customizing ProgressBar
+
+ ProgressBar consists of two parts: \l {Control::background}{background}
+ and \l {ProgressBar::indicator}{indicator}. Their implicit sizes are used
+ to calculate the implicit size of the control.
+
+ \section3 Background
+
+ \image qtquickcontrols2-progressbar-background.png
+
+ \snippet ProgressBar.qml background
+
+ \section3 Indicator
+
+ \image qtquickcontrols2-progressbar-indicator.png
+
+ \snippet ProgressBar.qml indicator
+
\section1 Customizing RadioButton
RadioButton consists of three parts: \l {Control::background}{background},
diff --git a/src/controls/qquickprogressbar.cpp b/src/controls/qquickprogressbar.cpp
index b6df343e..c02e2c4b 100644
--- a/src/controls/qquickprogressbar.cpp
+++ b/src/controls/qquickprogressbar.cpp
@@ -45,9 +45,24 @@ QT_BEGIN_NAMESPACE
\instantiates QQuickProgressBar
\inqmlmodule QtQuick.Controls
\ingroup indicators
- \brief A progress bar.
+ \brief A progress bar control.
- TODO
+ ProgressBar indicates the progress of an operation.
+
+ \table
+ \row \li \image qtquickcontrols2-progressbar-normal.png
+ \li A progress bar in its normal state.
+ \row \li \image qtquickcontrols2-progressbar-disabled.png
+ \li A progress bar that is disabled.
+ \endtable
+
+ \code
+ ProgressBar {
+ value: 0.5
+ }
+ \endcode
+
+ \sa {Customizing ProgressBar}
*/
class QQuickProgressBarPrivate : public QQuickControlPrivate
@@ -68,7 +83,9 @@ QQuickProgressBar::QQuickProgressBar(QQuickItem *parent) :
/*!
\qmlproperty real QtQuickControls2::ProgressBar::value
- TODO
+ This property holds the value in the range \c 0.0 - \c 1.0. The default value is \c 0.0.
+
+ \sa visualPosition
*/
qreal QQuickProgressBar::value() const
{
@@ -89,8 +106,16 @@ void QQuickProgressBar::setValue(qreal value)
/*!
\qmlproperty real QtQuickControls2::ProgressBar::visualPosition
+ \readonly
+
+ This property holds the visual position of the progress.
- TODO
+ The position is defined as a percentage of the control's size, scaled to
+ \c 0.0 - \c 1.0. When the control is \l mirrored, the value is equal to
+ \c {1.0 - value}. This makes the value suitable for visualizing the
+ progress, taking right-to-left support into account.
+
+ \sa value
*/
qreal QQuickProgressBar::visualPosition() const
{
@@ -103,7 +128,7 @@ qreal QQuickProgressBar::visualPosition() const
/*!
\qmlproperty bool QtQuickControls2::ProgressBar::indeterminate
- TODO
+ This property holds whether the progress bar is in an indeterminate mode.
*/
bool QQuickProgressBar::isIndeterminate() const
{
@@ -123,7 +148,9 @@ void QQuickProgressBar::setIndeterminate(bool indeterminate)
/*!
\qmlproperty Item QtQuickControls2::ProgressBar::indicator
- TODO
+ This property holds the indicator item.
+
+ \sa {Customizing ProgressBar}
*/
QQuickItem *QQuickProgressBar::indicator() const
{
diff --git a/src/imports/controls/ProgressBar.qml b/src/imports/controls/ProgressBar.qml
index ec067737..e71e2de8 100644
--- a/src/imports/controls/ProgressBar.qml
+++ b/src/imports/controls/ProgressBar.qml
@@ -49,6 +49,7 @@ AbstractProgressBar {
padding: Theme.padding
+ //! [indicator]
indicator: Item {
x: control.leftPadding
y: control.topPadding
@@ -86,7 +87,9 @@ AbstractProgressBar {
}
}
}
+ //! [indicator]
+ //! [background]
background: Rectangle {
implicitWidth: 120
implicitHeight: 6
@@ -99,4 +102,5 @@ AbstractProgressBar {
border.color: control.Theme.frameColor
color: "transparent"
}
+ //! [background]
}