diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-10-13 12:20:18 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-10-13 13:49:03 +0000 |
commit | 9735a6aaf421b99081b8c4244dd653dc8ce03c4c (patch) | |
tree | 9fec15d305c2c06e90ca1d0b23f16b68d5d5b20c /src | |
parent | 0e74ddf7183b9dd24cece15ac54d6cfc4a28eff6 (diff) |
RangeSlider: fix documentation review findings
- Expand detailed description
- link to Slider::snapMode documentation that has GIFs
Change-Id: If05eeaef7b2df7dd64e57b0160e1c856dc4d013e
Task-number: QTBUG-55904
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/quicktemplates2/qquickrangeslider.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickrangeslider.cpp b/src/quicktemplates2/qquickrangeslider.cpp index 21904a94..316efb31 100644 --- a/src/quicktemplates2/qquickrangeslider.cpp +++ b/src/quicktemplates2/qquickrangeslider.cpp @@ -56,13 +56,27 @@ QT_BEGIN_NAMESPACE RangeSlider is used to select a range specified by two values, by sliding each handle along a track. + In the example below, custom \l from and \l to values are set, and the + initial positions of the \l first and \l second handles are set: + \code RangeSlider { - first.value: 0.25 - second.value: 0.75 + from: 1 + to: 100 + first.value: 25 + second.value: 75 } \endcode + The \l {first.position} and \l {second.position} properties are defined as a + percentage of the control's size, scaled within the range \c {0.0 - 1.0}. + The \l {first.visualPosition} and \l {second.visualPosition} properties are + the same, except that they are reversed in a + \l {Right-to-left User Interfaces}{right-to-left} application. + The \c visualPosition is useful for positioning the handles when styling + RangeSlider. In the example above, \l {first.visualPosition} will be \c 0.24 + in a left-to-right application, and \c 0.76 in a right-to-left application. + \sa {Customizing RangeSlider}, {Input Controls} */ @@ -557,6 +571,9 @@ void QQuickRangeSlider::setStepSize(qreal step) \value RangeSlider.SnapAlways The slider snaps while the handle is dragged. \value RangeSlider.SnapOnRelease The slider does not snap while being dragged, but only after the handle is released. + For visual explanations of the various modes, see the + \l {Slider::}{snapMode} documentation of \l Slider. + \sa stepSize */ QQuickRangeSlider::SnapMode QQuickRangeSlider::snapMode() const |