summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qheaderview_p.h
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-02-27 10:56:42 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-29 00:05:38 +0100
commite500946de964649b03fa9d73dd98e58a973bc956 (patch)
tree01e13251f1a81308404cc00c272d28d044df9b76 /src/widgets/itemviews/qheaderview_p.h
parent6363672163a8d40c685c0120f76b261685ee34be (diff)
QHeaderView - remove sectionCount variable
A previous patch ensures that we have exactly one section in a Span. ( see SHA : b800d8b94a7861ecf8853621f6556fca186fb5b7 ) Therefore we no longer need the sectionCount variable. We have assess to it through the sectionSpan.count. To keep this patch quite simple the variable sectionCount has been changed to a function returning the count value. Change-Id: Ibc419eafa38ab64b08f93074cb6ae4b8518995f6 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/widgets/itemviews/qheaderview_p.h')
-rw-r--r--src/widgets/itemviews/qheaderview_p.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h
index 2c657221dd..a2b0ef2180 100644
--- a/src/widgets/itemviews/qheaderview_p.h
+++ b/src/widgets/itemviews/qheaderview_p.h
@@ -84,7 +84,6 @@ public:
pressed(-1),
hover(-1),
length(0),
- sectionCount(0),
movableSections(false),
clickableSections(false),
highlightSelected(false),
@@ -137,11 +136,13 @@ public:
inline void prepareSectionSelected() {
if (!selectionModel || !selectionModel->hasSelection())
sectionSelected.clear();
- else if (sectionSelected.count() != sectionCount * 2)
- sectionSelected.fill(false, sectionCount * 2);
+ else if (sectionSelected.count() != sectionCount() * 2)
+ sectionSelected.fill(false, sectionCount() * 2);
else sectionSelected.fill(false);
}
+ inline int sectionCount() const {return sectionSpans.count();}
+
inline bool reverse() const {
return orientation == Qt::Horizontal && q_func()->isRightToLeft();
}
@@ -182,11 +183,11 @@ public:
}
inline void initializeIndexMapping() const {
- if (visualIndices.count() != sectionCount
- || logicalIndices.count() != sectionCount) {
- visualIndices.resize(sectionCount);
- logicalIndices.resize(sectionCount);
- for (int s = 0; s < sectionCount; ++s) {
+ if (visualIndices.count() != sectionCount()
+ || logicalIndices.count() != sectionCount()) {
+ visualIndices.resize(sectionCount());
+ logicalIndices.resize(sectionCount());
+ for (int s = 0; s < sectionCount(); ++s) {
visualIndices[s] = s;
logicalIndices[s] = s;
}
@@ -194,7 +195,7 @@ public:
}
inline void clearCascadingSections() {
- firstCascadingSection = sectionCount;
+ firstCascadingSection = sectionSpans.count();
lastCascadingSection = 0;
cascadingSectionSize.clear();
}
@@ -265,7 +266,6 @@ public:
int hover;
int length;
- int sectionCount;
bool movableSections;
bool clickableSections;
bool highlightSelected;