diff options
author | Liang Qi <liang.qi@qt.io> | 2016-10-19 07:58:53 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-10-19 09:01:43 +0200 |
commit | 124dd9adb5882048e44dcd012e08899d4e480196 (patch) | |
tree | f6022e22f08f2128df2b0cc2081c2b8843408aba /src/quicktemplates2/qquickrangeslider.cpp | |
parent | 6cb2367f01c1f78d760c1a4d70002cf5a5046396 (diff) | |
parent | d6fbb1239950f392f3d569da7dde226e865b7bcd (diff) |
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts:
src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml
src/imports/controls/material/qquickmaterialstyle.cpp
Change-Id: I00b533e28407f87a31588e92109a468a5bfb4cc8
Diffstat (limited to 'src/quicktemplates2/qquickrangeslider.cpp')
-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 a4862fa6..3caf5042 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} */ @@ -596,6 +610,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 |