summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qheaderview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/itemviews/qheaderview.cpp')
-rw-r--r--src/widgets/itemviews/qheaderview.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 2b3e1f1732..e046e4781f 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -1499,7 +1499,8 @@ bool QHeaderView::stretchLastSection() const
void QHeaderView::setStretchLastSection(bool stretch)
{
Q_D(QHeaderView);
- const bool changedStretchMode = (d->stretchLastSection != stretch);
+ if (d->stretchLastSection == stretch)
+ return;
d->stretchLastSection = stretch;
if (d->state != QHeaderViewPrivate::NoState)
return;
@@ -1507,8 +1508,7 @@ void QHeaderView::setStretchLastSection(bool stretch)
d->setNewLastSection(d->lastVisibleVisualIndex());
resizeSections();
} else {
- if (changedStretchMode)
- d->restoreSizeOnPrevLastSection();
+ d->restoreSizeOnPrevLastSection();
}
}