diff options
author | Liang Qi <liang.qi@qt.io> | 2017-11-15 09:11:03 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-11-15 09:11:04 +0100 |
commit | 558b3d09e21fe1e0cc43d82fc76e3eea981d82d2 (patch) | |
tree | cb5ef85534ab3bb08ca03ba7e8c320a58b1642b7 /src/quicktemplates2/qquickslider.cpp | |
parent | 442843db6f5dce6b594448d43b380c9b884a7c91 (diff) | |
parent | a0559ea88be32e19e83b2131cb26e61e873dc817 (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: Ide4b85626dd153b534c39a3afa2f3b9e732badf5
Diffstat (limited to 'src/quicktemplates2/qquickslider.cpp')
-rw-r--r-- | src/quicktemplates2/qquickslider.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/quicktemplates2/qquickslider.cpp b/src/quicktemplates2/qquickslider.cpp index 8628f981..b358663d 100644 --- a/src/quicktemplates2/qquickslider.cpp +++ b/src/quicktemplates2/qquickslider.cpp @@ -545,10 +545,10 @@ void QQuickSlider::setHandle(QQuickItem *handle) qreal QQuickSlider::valueAt(qreal position) const { Q_D(const QQuickSlider); - const qreal value = d->from + (d->to - d->from) * position; + const qreal value = (d->to - d->from) * position; if (qFuzzyIsNull(d->stepSize)) - return value; - return qRound(value / d->stepSize) * d->stepSize; + return d->from + value; + return d->from + qRound(value / d->stepSize) * d->stepSize; } /*! |