QHeaderView::setStretchLastSection: make it a noop when setting the same value

For some reason this setter wasn't protected against setting
the same value again, and always did work (including resizing
the last section when setting it to false).

Change-Id: I044404eef95d52d165100254f3afd489997e0872
Task-number: QTBUG-52308
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
bb10
Giuseppe D'Angelo 2016-04-02 20:48:43 +02:00
parent a7b0cb467c
commit 4faadb3ad3
1 changed files with 2 additions and 0 deletions

View File

@ -1473,6 +1473,8 @@ bool QHeaderView::stretchLastSection() const
void QHeaderView::setStretchLastSection(bool stretch)
{
Q_D(QHeaderView);
if (d->stretchLastSection == stretch)
return;
d->stretchLastSection = stretch;
if (d->state != QHeaderViewPrivate::NoState)
return;