diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-06-10 20:15:09 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-06-10 19:18:13 +0000 |
commit | 353f77e6c11c65b04ebe8b02aa087a403069979d (patch) | |
tree | 886d53accbae69abcc77f494f75c5516eb3b132a /src/controls | |
parent | fe98a60d904cafb9a82a28aa27bd2836dada67f9 (diff) |
Docs: ProgressBar
Change-Id: I82e524281c64580f9a910b700f0efbf53a4dabe7
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/controls')
-rw-r--r-- | src/controls/doc/images/qtquickcontrols2-progressbar-background.png | bin | 0 -> 116 bytes | |||
-rw-r--r-- | src/controls/doc/images/qtquickcontrols2-progressbar-disabled.png | bin | 0 -> 320 bytes | |||
-rw-r--r-- | src/controls/doc/images/qtquickcontrols2-progressbar-indicator.png | bin | 0 -> 286 bytes | |||
-rw-r--r-- | src/controls/doc/images/qtquickcontrols2-progressbar-normal.png | bin | 0 -> 322 bytes | |||
-rw-r--r-- | src/controls/doc/src/qtquickcontrols2-customize.qdoc | 18 | ||||
-rw-r--r-- | src/controls/qquickprogressbar.cpp | 39 |
6 files changed, 51 insertions, 6 deletions
diff --git a/src/controls/doc/images/qtquickcontrols2-progressbar-background.png b/src/controls/doc/images/qtquickcontrols2-progressbar-background.png Binary files differnew file mode 100644 index 00000000..82070b8c --- /dev/null +++ b/src/controls/doc/images/qtquickcontrols2-progressbar-background.png diff --git a/src/controls/doc/images/qtquickcontrols2-progressbar-disabled.png b/src/controls/doc/images/qtquickcontrols2-progressbar-disabled.png Binary files differnew file mode 100644 index 00000000..4baf5c83 --- /dev/null +++ b/src/controls/doc/images/qtquickcontrols2-progressbar-disabled.png diff --git a/src/controls/doc/images/qtquickcontrols2-progressbar-indicator.png b/src/controls/doc/images/qtquickcontrols2-progressbar-indicator.png Binary files differnew file mode 100644 index 00000000..02e888ed --- /dev/null +++ b/src/controls/doc/images/qtquickcontrols2-progressbar-indicator.png diff --git a/src/controls/doc/images/qtquickcontrols2-progressbar-normal.png b/src/controls/doc/images/qtquickcontrols2-progressbar-normal.png Binary files differnew file mode 100644 index 00000000..783d721d --- /dev/null +++ b/src/controls/doc/images/qtquickcontrols2-progressbar-normal.png 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 { |