summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
diff options
context:
space:
mode:
authorThorbjørn Martsum <tmartsum@gmail.com>2013-08-07 08:15:58 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-16 05:34:18 +0200
commitf633bc7f7fb72ba261b46e979603376f0016c085 (patch)
treeb8e6aef18069d144052cb6c8151c80ba531d0102 /tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
parent592c8bffd6afd485063e9339e0707829884180ac (diff)
QHeaderView - reduce memory usage
Though the worst case memory usage was improved in b800d8b94a7861ecf8853621f6556fca186fb5b7 the best case usage changed. Since best case is the same as worst case in Qt5, we should use as little as possible, which this patch ensures. We reduce the memory usage from 3 to 2 ints per section - which is half of worst case in Qt4. There seems to be no bigger cost in performance doing that. The recalcSectionStartPos is still very fast. This patch limits the maximum section size to (2^20) ~ 1.000.000 pixels. This alleviates Task-number: QTBUG-32325 Change-Id: I9b7530030a31b4e35cf1ca9e32c6b936f5ea9790 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp')
-rw-r--r--tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
index fa67e16db9..ba3a150154 100644
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
@@ -341,8 +341,8 @@ void tst_QHeaderView::getSetCheck()
QVERIFY(obj1.defaultSectionSize() >= 0);
obj1.setDefaultSectionSize(0);
QCOMPARE(0, obj1.defaultSectionSize());
- obj1.setDefaultSectionSize(INT_MAX);
- QCOMPARE(INT_MAX, obj1.defaultSectionSize());
+ obj1.setDefaultSectionSize(99999);
+ QCOMPARE(99999, obj1.defaultSectionSize());
// int QHeaderView::minimumSectionSize()
// void QHeaderView::setMinimumSectionSize(int)
@@ -350,8 +350,8 @@ void tst_QHeaderView::getSetCheck()
QVERIFY(obj1.minimumSectionSize() >= 0);
obj1.setMinimumSectionSize(0);
QCOMPARE(0, obj1.minimumSectionSize());
- obj1.setMinimumSectionSize(INT_MAX);
- QCOMPARE(INT_MAX, obj1.minimumSectionSize());
+ obj1.setMinimumSectionSize(99999);
+ QCOMPARE(99999, obj1.minimumSectionSize());
// int QHeaderView::offset()
// void QHeaderView::setOffset(int)