aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang Hao <zhanghao@uniontech.com>2021-10-12 19:28:10 +0800
committerJani Heikkinen <jani.heikkinen@qt.io>2021-10-13 12:17:49 +0000
commit071daed9a9a1a76ec59b56ec8c651dbe8b23db4d (patch)
treea59bba5fdafe7f0b8722740c402063b924fac8cd
parentbe1ca646b79214f91e54a766a24aca9dc3c97f51 (diff)
Dial: simplify logic in handleMove and handleRelease function
We know wrap is false, and we can also remove some unnecessary parentheses. Change-Id: I1f96a68858bc2b103ac5a65f62473dabcd64bf23 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 5825b38255ee106212f652c1a6a8f28f1790194b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 42c040b64b0b8b9b3ae4d76de1e6ec9d70b1eb5f) Reviewed-by: Zhang Hao <zhanghao@uniontech.com>
-rw-r--r--src/quicktemplates2/qquickdial.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickdial.cpp b/src/quicktemplates2/qquickdial.cpp
index bd9c864d46..2f290d62e6 100644
--- a/src/quicktemplates2/qquickdial.cpp
+++ b/src/quicktemplates2/qquickdial.cpp
@@ -259,7 +259,7 @@ void QQuickDialPrivate::handleMove(const QPointF &point)
if (snapMode == QQuickDial::SnapAlways)
pos = snapPosition(pos);
- if (wrap || (!wrap && (isHorizontalOrVertical() || !isLargeChange(point, pos)))) {
+ if (wrap || isHorizontalOrVertical() || !isLargeChange(point, pos)) {
if (live)
q->setValue(valueAt(pos));
else
@@ -279,7 +279,7 @@ void QQuickDialPrivate::handleRelease(const QPointF &point)
if (snapMode != QQuickDial::NoSnap)
pos = snapPosition(pos);
- if (wrap || (!wrap && (isHorizontalOrVertical() || !isLargeChange(point, pos))))
+ if (wrap || isHorizontalOrVertical() || !isLargeChange(point, pos))
q->setValue(valueAt(pos));
if (!qFuzzyCompare(pos, oldPos))
emit q->moved();