summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qheaderview_p.h
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-04-03 06:38:48 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-11 01:42:12 +0200
commit699f2424eba929d04b081af2a0cad74e2e58e235 (patch)
tree17a3c11f072ec3f3f766b7b0dd6488b15dddbc48 /src/widgets/itemviews/qheaderview_p.h
parent8692326629eb736a007a30f9ccb91c72409c9117 (diff)
QHeaderView - rename many spans classes and variables
In (SHA) b800d8b94a7861ecf8853621f6556fca186fb5b7 the span model was replaced with a plain section model. The code however still has variables and classes called someting with spans which would be confusing for possible new readers of the code. This patch cleans up most of it. It only renames classes,functions and variables (and not any semantics or the public API). Change-Id: I6ceb068c7317223f0d8e37f8032197f518d0174c 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.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h
index a2b0ef2180..d6e6ab991a 100644
--- a/src/widgets/itemviews/qheaderview_p.h
+++ b/src/widgets/itemviews/qheaderview_p.h
@@ -141,7 +141,7 @@ public:
else sectionSelected.fill(false);
}
- inline int sectionCount() const {return sectionSpans.count();}
+ inline int sectionCount() const {return sectionItems.count();}
inline bool reverse() const {
return orientation == Qt::Horizontal && q_func()->isRightToLeft();
@@ -195,7 +195,7 @@ public:
}
inline void clearCascadingSections() {
- firstCascadingSection = sectionSpans.count();
+ firstCascadingSection = sectionItems.count();
lastCascadingSection = 0;
cascadingSectionSize.clear();
}
@@ -283,9 +283,9 @@ public:
QHeaderView::ResizeMode globalResizeMode;
QList<QPersistentModelIndex> persistentHiddenSections;
mutable bool sectionStartposRecalc;
- // header section spans
+ // header sections
- struct SectionSpan {
+ struct SectionItem {
int size;
union { // This union is made in order to save space and ensure good vector performance (on remove)
mutable int calculated_startpos; // <- this is the primary used member.
@@ -293,8 +293,8 @@ public:
int tmpDataStreamSectionCount; // recalcSectionStartPos() or set sectionStartposRecalc to true
}; // to ensure that calculated_startpos will be calculated afterwards.
QHeaderView::ResizeMode resizeMode;
- inline SectionSpan() : size(0), resizeMode(QHeaderView::Interactive) {}
- inline SectionSpan(int length, QHeaderView::ResizeMode mode)
+ inline SectionItem() : size(0), resizeMode(QHeaderView::Interactive) {}
+ inline SectionItem(int length, QHeaderView::ResizeMode mode)
: size(length), calculated_startpos(-1), resizeMode(mode) {}
inline int sectionSize() const { return size; }
inline int calculatedEndPos() const { return calculated_startpos + size; }
@@ -306,34 +306,34 @@ public:
#endif
};
- QVector<SectionSpan> sectionSpans;
+ QVector<SectionItem> sectionItems;
- void createSectionSpan(int start, int end, int size, QHeaderView::ResizeMode mode);
- void removeSectionsFromSpans(int start, int end);
- void resizeSectionSpan(int visualIndex, int oldSize, int newSize);
+ void createSectionItems(int start, int end, int size, QHeaderView::ResizeMode mode);
+ void removeSectionsFromSectionItems(int start, int end);
+ void resizeSectionItem(int visualIndex, int oldSize, int newSize);
void setDefaultSectionSize(int size);
void recalcSectionStartPos() const; // not really const
inline int headerSectionCount() const { // for debugging
- return sectionSpans.count();
+ return sectionItems.count();
}
inline int headerLength() const { // for debugging
int len = 0;
- for (int i = 0; i < sectionSpans.count(); ++i)
- len += sectionSpans.at(i).size;
+ for (int i = 0; i < sectionItems.count(); ++i)
+ len += sectionItems.at(i).size;
return len;
}
inline void removeSpans(const QList<int> &spans) {
for (int i = spans.count() - 1; i >= 0; --i) {
- length -= sectionSpans.at(spans.at(i)).size;
- sectionSpans.remove(spans.at(i));
+ length -= sectionItems.at(spans.at(i)).size;
+ sectionItems.remove(spans.at(i));
}
}
inline int sectionSpanIndex(int visual) const {
- if (visual < sectionSpans.count() && visual >= 0) {
+ if (visual < sectionItems.count() && visual >= 0) {
return visual;
}
return -1;