summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-06-25 06:31:58 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-04 18:00:41 +0200
commit524c3e05e811d81fbcd71eedb377b7eaa0a21ef3 (patch)
treedddcab9e6de9d19b3a58669ac6cf3b0ee812295c /src
parente78b3e80e6f9310ca82ba1a1f1a59b2166ac872e (diff)
QHeaderView - prevent negative default+minimum section sizes
In 96f1fe8855082017fbbecccdab1eb11fd8c1f870 we agreed that sections with negative sizes did not make sense. Of the same reason default section sizes and minimum section sizes should be not negative. Change-Id: I6a770e7f510d8e2bb90bfd8f38b4fa0566fc137b Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/itemviews/qheaderview.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 01cfc4034e..23245a7733 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -1469,6 +1469,8 @@ int QHeaderView::defaultSectionSize() const
void QHeaderView::setDefaultSectionSize(int size)
{
Q_D(QHeaderView);
+ if (size < 0)
+ return;
d->setDefaultSectionSize(size);
}
@@ -1502,6 +1504,8 @@ int QHeaderView::minimumSectionSize() const
void QHeaderView::setMinimumSectionSize(int size)
{
Q_D(QHeaderView);
+ if (size < 0)
+ return;
d->minimumSectionSize = size;
}