path: root/src/widgets/itemviews/qheaderview_p.h
diff options
authorThorbjørn Lund Martsum <>2012-02-16 10:12:30 +0100
committerQt by Nokia <>2012-02-21 12:51:46 +0100
commita4e4c3100780be27070c8916d25a9f7c461d1e11 (patch)
tree3a9b76d933f8c227a32119bcbf7c1bdb78a65558 /src/widgets/itemviews/qheaderview_p.h
parent84438a77ccff294aa8b63dc6b5b11a58cdca0c12 (diff)
QHeaderview - many sections removed performance boost.
When the QHeaderView model rowCount is decreased then the headerview needs to remove some sections. If e.g swapSections had occured then qheaderview before this patch did a very slow removal by removing one section at a time and for each section it restored visual and logical indexes. By temporarily storing the logical index on the section we can reduce the execution time of this a lot. The old code is only faster when we remove one index (and is kept for that situation) There is a complexity in difference (and many factors in our qheaderview benchmark (the trunc part)) Change-Id: If45eab17fbca3364d458b004980570b5d013e4bd Reviewed-by: Stephen Kelly <>
Diffstat (limited to 'src/widgets/itemviews/qheaderview_p.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h
index 9d7d97f582..4d1f4ba5a0 100644
--- a/src/widgets/itemviews/qheaderview_p.h
+++ b/src/widgets/itemviews/qheaderview_p.h
@@ -288,6 +288,7 @@ public:
struct SectionSpan {
int size;
mutable int calculated_startpos;
+ mutable int tmpLogIdx;
QHeaderView::ResizeMode resizeMode;
inline SectionSpan() : size(0), resizeMode(QHeaderView::Interactive) {}
inline SectionSpan(int length, QHeaderView::ResizeMode mode)