QHeaderView - do not ignore -1 as minimum section size

We claim that -1 is a special automatic value, but calling
setMinimumSectionSize with -1 is unfortunately ignored due a
regression in 524c3e05e8

Change-Id: I7d7e5dbbf78e561849d2f2352c9edb2df36aa181
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
Thorbjørn Martsum 2013-11-12 20:01:22 +01:00 committed by The Qt Project
parent 2026e50259
commit aafbd7392e
2 changed files with 3 additions and 1 deletions

View File

@ -1599,7 +1599,7 @@ int QHeaderView::minimumSectionSize() const
void QHeaderView::setMinimumSectionSize(int size)
{
Q_D(QHeaderView);
if (size < 0 || size > maxSizeSection)
if (size < -1 || size > maxSizeSection)
return;
d->minimumSectionSize = size;
if (d->minimumSectionSize > maximumSectionSize())

View File

@ -368,6 +368,8 @@ void tst_QHeaderView::getSetCheck()
QCOMPARE(0, obj1.minimumSectionSize());
obj1.setMinimumSectionSize(99999);
QCOMPARE(99999, obj1.minimumSectionSize());
obj1.setMinimumSectionSize(-1);
QVERIFY(obj1.minimumSectionSize() < 100);
// int QHeaderView::offset()
// void QHeaderView::setOffset(int)