summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2021-10-14 10:19:11 -0700
committerThiago Macieira <thiago.macieira@intel.com>2021-10-16 08:49:27 -0700
commitd91b2a4479dc92d7b1232e42329977e909331909 (patch)
tree6ebf3c7ee03b3d6f6a6bb6b13431aa7d198619f6
parent362e56b520cd5f3efcc7600d558b515a8aec6a79 (diff)
QtWidgets: remove set-but-unused variables
Found by clang 13: qlayoutengine.cpp:80:9: warning: variable 'cMax' set but not used [-Wunused-but-set-variable] Change-Id: Iea05060bc2c046928536fffd16adf54d1527e657 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/widgets/kernel/qlayoutengine.cpp2
-rw-r--r--src/widgets/util/qscroller.cpp6
2 files changed, 0 insertions, 8 deletions
diff --git a/src/widgets/kernel/qlayoutengine.cpp b/src/widgets/kernel/qlayoutengine.cpp
index 98fc85c3c4..e318300f98 100644
--- a/src/widgets/kernel/qlayoutengine.cpp
+++ b/src/widgets/kernel/qlayoutengine.cpp
@@ -77,7 +77,6 @@ void qGeomCalc(QList<QLayoutStruct> &chain, int start, int count, int pos, int s
{
int cHint = 0;
int cMin = 0;
- int cMax = 0;
int sumStretch = 0;
int sumSpacing = 0;
int expandingCount = 0;
@@ -93,7 +92,6 @@ void qGeomCalc(QList<QLayoutStruct> &chain, int start, int count, int pos, int s
data->done = false;
cHint += data->smartSizeHint();
cMin += data->minimumSize;
- cMax += data->maximumSize;
sumStretch += data->stretch;
if (!data->empty) {
/*
diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp
index e6164178a8..96e0701ecf 100644
--- a/src/widgets/util/qscroller.cpp
+++ b/src/widgets/util/qscroller.cpp
@@ -1760,7 +1760,6 @@ void QScrollerPrivate::setContentPositionHelperDragging(const QPointF &deltaPos)
qScrollerDebug() << "QScroller::setContentPositionHelperDragging(" << deltaPos << " [pix])";
qScrollerDebug() << " --> overshoot:" << overshootPosition << "- old pos:" << oldPos << "- new pos:" << newPos;
- QPointF oldClampedPos = clampToRect(oldPos, contentPosRange);
QPointF newClampedPos = clampToRect(newPos, contentPosRange);
// --- handle overshooting and stop if the coordinate is going back inside the normal area
@@ -1775,9 +1774,6 @@ void QScrollerPrivate::setContentPositionHelperDragging(const QPointF &deltaPos)
bool canOvershootX = !noOvershootX && (alwaysOvershootX || contentPosRange.width());
bool canOvershootY = !noOvershootY && (alwaysOvershootY || contentPosRange.height());
- qreal oldOvershootX = (canOvershootX) ? oldPos.x() - oldClampedPos.x() : 0;
- qreal oldOvershootY = (canOvershootY) ? oldPos.y() - oldClampedPos.y() : 0;
-
qreal newOvershootX = (canOvershootX) ? newPos.x() - newClampedPos.x() : 0;
qreal newOvershootY = (canOvershootY) ? newPos.y() - newClampedPos.y() : 0;
@@ -1788,8 +1784,6 @@ void QScrollerPrivate::setContentPositionHelperDragging(const QPointF &deltaPos)
qScrollerDebug() << " --> canOS:" << canOvershootX << "newOS:" << newOvershootX << "maxOS:" << maxOvershootX;
if (sp->overshootDragResistanceFactor) {
- oldOvershootX *= sp->overshootDragResistanceFactor;
- oldOvershootY *= sp->overshootDragResistanceFactor;
newOvershootX *= sp->overshootDragResistanceFactor;
newOvershootY *= sp->overshootDragResistanceFactor;
}