diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-01-27 12:50:17 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-01-27 13:37:47 +0000 |
commit | b026ebf67a95c6bca186e69e6e71b6fb70b4eeb3 (patch) | |
tree | aa2230cf29158360c3a1869ee121b96ed37c8da7 /src/quicktemplates2 | |
parent | 8968ce178453c3b6a74b95ba34fb492fd29ef764 (diff) |
Default QQuickSlider::live to true
[ChangeLog][Important Behavior Changes] On a popular demand, Slider
has been changed to report live value updates. This can be disabled
by setting Slider::live to false.
Change-Id: I48c6a92eb794d2846cfff96d8784c53c22843573
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r-- | src/quicktemplates2/qquickslider.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/quicktemplates2/qquickslider.cpp b/src/quicktemplates2/qquickslider.cpp index ff41595b..c95385dd 100644 --- a/src/quicktemplates2/qquickslider.cpp +++ b/src/quicktemplates2/qquickslider.cpp @@ -94,7 +94,7 @@ public: value(0), position(0), stepSize(0), - live(false), + live(true), pressed(false), touchId(-1), orientation(Qt::Horizontal), @@ -304,12 +304,7 @@ void QQuickSlider::setTo(qreal to) This property holds the value in the range \c from - \c to. The default value is \c 0.0. - Unlike the \l position property, the \c value is not updated by default - while the handle is dragged, but only after the value has been chosen and - the slider has been released. The \l live property can be used to make the - slider provide live updates for the \c value property. - - \sa position, live, valueAt() + \sa position */ qreal QQuickSlider::value() const { @@ -338,8 +333,7 @@ void QQuickSlider::setValue(qreal value) This property holds the logical position of the handle. The position is expressed as a fraction of the control's size, in the range - \c {0.0 - 1.0}. The \c position is continuously updated while the - handle is dragged. For visualizing a slider, the right-to-left aware + \c {0.0 - 1.0}. For visualizing a slider, the right-to-left aware \l visualPosition should be used instead. \sa value, visualPosition, valueAt() @@ -441,9 +435,9 @@ void QQuickSlider::setSnapMode(SnapMode mode) This property holds whether the slider provides live updates for the \l value property while the handle is dragged. - The default value is \c false. + The default value is \c true. - \sa value + \sa value, valueAt() */ bool QQuickSlider::live() const { @@ -540,11 +534,6 @@ void QQuickSlider::setHandle(QQuickItem *handle) Returns the value for the given \a position. - The \l value property is not updated while the handle is dragged, but this - method can be used to get continuous value updates: - - \snippet qtquickcontrols2-tooltip-slider.qml 1 - \sa value, position */ qreal QQuickSlider::valueAt(qreal position) const |