45 Q_DECLARE_PUBLIC(QHeaderView)
99 void resizeSections(QHeaderView::ResizeMode globalMode,
bool useGlobalMode =
false);
102 int logicalEnd,
const QModelIndex &destinationParent,
103 int logicalDestination);
104 void sectionsMoved(
const QModelIndex &sourceParent,
int logicalStart,
105 int logicalEnd,
const QModelIndex &destinationParent,
106 int logicalDestination);
117 return (selectionModel ? selectionModel->rowIntersectsSelection(row, root) :
false);
121 return (selectionModel ? selectionModel->columnIntersectsSelection(column, root) :
false);
125 return (orientation == Qt::Horizontal ? columnIntersectsSelection(logical) : rowIntersectsSelection(logical));
129 return (selectionModel ? selectionModel->isRowSelected(row, root) :
false);
133 return (selectionModel ? selectionModel->isColumnSelected(column, root) :
false);
137 if (!selectionModel || !selectionModel->hasSelection())
138 sectionSelected.clear();
139 else if (sectionSelected.size() != sectionCount() * 2)
140 sectionSelected.fill(
false, sectionCount() * 2);
141 else sectionSelected.fill(
false);
145 return noSectionMemoryUsage() ? countInNoSectionItemsMode : sectionItems.size();
149 return orientation == Qt::Horizontal && q_func()->isRightToLeft();
153 return logicalIndices.isEmpty() ? visualIndex : logicalIndices.at(visualIndex);
157 return visualIndices.isEmpty() ? logicalIndex : visualIndices.at(logicalIndex);
163 defaultAlignment = (o == Qt::Horizontal
164 ? Qt::Alignment(Qt::AlignCenter)
165 : Qt::AlignLeft|Qt::AlignVCenter);
169 return !noSectionMemoryUsage() && sectionItems.at(visual).isHidden;
173 sectionItems[visual].isHidden = hidden;
183 cachedSizeHint = QSize();
187 if (visualIndices.size() != sectionCount()
188 || logicalIndices.size() != sectionCount()) {
189 visualIndices.resize(sectionCount());
190 logicalIndices.resize(sectionCount());
192 visualIndices[s] = s;
193 logicalIndices[s] = s;
199 firstCascadingSection = sectionItems.size();
201 cascadingSectionSize.clear();
205 if (!cascadingSectionSize.contains(visual)) {
206 cascadingSectionSize.insert(visual, size);
213 return headerSectionResizeMode(visual) == QHeaderView::Interactive;
217 return (orientation == Qt::Horizontal
218 ? model->columnCount(root)
219 : model->rowCount(root));
223 if (!delayedResize.isActive())
224 delayedResize.start(0, q_func());
228 if (delayedResize.isActive() && state == NoState) {
229 const_cast<QHeaderView*>(q_func())->resizeSections();
235 for (
const QMetaObject::Connection &connection : modelConnections)
236 QObject::disconnect(connection);
318#ifndef QT_NO_DATASTREAM
319 inline void write(QDataStream &out)
const
320 { out <<
static_cast<
int>(size); out << 1; out << (
int)resizeMode; }
321 inline void read(QDataStream &in)
322 {
int m; in >> m; size = m; in >> tmpDataStreamSectionCount; in >> m; resizeMode = m; }
328 HeaderMode
headerMode = HeaderMode::InitialNoSectionMemoryUsage;
332 return (
headerMode == HeaderMode::InitialNoSectionMemoryUsage);
350 void createSectionItems(
int start,
int end,
int sectionSize, QHeaderView::ResizeMode mode);
359 for (
const auto §ion : sectionItems)
366 QBitArray sectionHidden;
367 if (!hiddenSectionSize.isEmpty()) {
368 sectionHidden.resize(sectionItems.size());
369 for (
int u = 0; u < sectionItems.size(); ++u)
370 sectionHidden[u] = sectionItems.at(u).isHidden;
372 return sectionHidden;
377 for (
int i = 0; i < sectionHidden.size(); ++i)
378 sectionData[i].isHidden = sectionHidden.at(i);
393 void setScrollOffset(
const QScrollBar *scrollBar, QAbstractItemView::ScrollMode scrollMode);
396#ifndef QT_NO_DATASTREAM
397 void write(QDataStream &out)
const;
398 bool read(QDataStream &in);