![]() |
Qt 6.x
The Qt SDK
|
#include <qtableview_p.h>
Public Types | |
enum class | SearchDirection { Increasing , Decreasing } |
Definition at line 100 of file qtableview_p.h.
|
strong |
Enumerator | |
---|---|
Increasing | |
Decreasing |
Definition at line 204 of file qtableview_p.h.
|
inline |
Definition at line 104 of file qtableview_p.h.
void QTableViewPrivate::_q_selectColumn | ( | int | column | ) |
Definition at line 3389 of file qtableview.cpp.
References selectColumn().
void QTableViewPrivate::_q_selectRow | ( | int | row | ) |
Definition at line 3384 of file qtableview.cpp.
References selectRow().
void QTableViewPrivate::_q_sortIndicatorChanged | ( | int | column, |
Qt::SortOrder | order | ||
) |
Sort the model when the header sort indicator changed
Definition at line 999 of file qtableview.cpp.
References QAbstractItemViewPrivate::model.
void QTableViewPrivate::_q_updateSpanInsertedColumns | ( | const QModelIndex & | parent, |
int | start, | ||
int | end | ||
) |
Updates spans after column insertion.
Definition at line 969 of file qtableview.cpp.
References parent, Q_UNUSED, spans, and QSpanCollection::updateInsertedColumns().
void QTableViewPrivate::_q_updateSpanInsertedRows | ( | const QModelIndex & | parent, |
int | start, | ||
int | end | ||
) |
Updates spans after row insertion.
Definition at line 959 of file qtableview.cpp.
References parent, Q_UNUSED, spans, and QSpanCollection::updateInsertedRows().
void QTableViewPrivate::_q_updateSpanRemovedColumns | ( | const QModelIndex & | parent, |
int | start, | ||
int | end | ||
) |
Updates spans after column removal.
Definition at line 989 of file qtableview.cpp.
References parent, Q_UNUSED, spans, and QSpanCollection::updateRemovedColumns().
void QTableViewPrivate::_q_updateSpanRemovedRows | ( | const QModelIndex & | parent, |
int | start, | ||
int | end | ||
) |
Updates spans after row removal.
Definition at line 979 of file qtableview.cpp.
References parent, Q_UNUSED, spans, and QSpanCollection::updateRemovedRows().
|
inline |
Definition at line 137 of file qtableview_p.h.
|
inline |
Definition at line 175 of file qtableview_p.h.
Referenced by setSpan().
|
inline |
Definition at line 190 of file qtableview_p.h.
|
inline |
Definition at line 184 of file qtableview_p.h.
Referenced by visualSpanRect().
void QTableViewPrivate::drawAndClipSpans | ( | const QRegion & | area, |
QPainter * | painter, | ||
const QStyleOptionViewItem & | option, | ||
QBitArray * | drawn, | ||
int | firstVisualRow, | ||
int | lastVisualRow, | ||
int | firstVisualColumn, | ||
int | lastVisualColumn | ||
) |
Draws the spanning cells within rect area, and clips them off as preparation for the main drawing loop. drawn is a QBitArray of visualRowCountxvisualCoulumnCount which say if particular cell has been drawn
Definition at line 870 of file qtableview.cpp.
References QAbstractItemViewPrivate::alternatingColors, area(), drawCell(), QStyleOptionButton::features, horizontalHeader, QAbstractItemModel::index(), QSet< T >::insert(), logicalColumn(), logicalRow(), QAbstractItemViewPrivate::model, opt, painter, rect, QStyleOption::rect, QAbstractItemViewPrivate::root, QAbstractItemViewPrivate::scrollDelayOffset, QHeaderView::sectionsMoved(), QBitArray::setBit(), QPainter::setClipRegion(), showGrid, QSpanCollection::spans, spans, QSpanCollection::spansInRect(), verticalHeader, viewport(), visualColumn(), QHeaderView::visualIndex(), visualRow(), and visualSpanRect().
void QTableViewPrivate::drawCell | ( | QPainter * | painter, |
const QStyleOptionViewItem & | option, | ||
const QModelIndex & | index | ||
) |
Draws a table cell.
Definition at line 1008 of file qtableview.cpp.
References QPalette::Disabled, QAbstractItemModel::flags(), focus, QAbstractItemViewPrivate::hover, QItemSelectionModel::isSelected(), Qt::ItemIsEnabled, QAbstractItemViewPrivate::model, QPalette::Normal, opt, painter, QStyleOption::palette, QStyle::PE_PanelItemViewRow, QAbstractItemViewPrivate::selectionModel, QPalette::setCurrentColorGroup(), QStyleOption::state, QStyle::State_Enabled, QStyle::State_HasFocus, QStyle::State_MouseOver, QStyle::State_Selected, and viewport().
Referenced by drawAndClipSpans().
|
inline |
Definition at line 178 of file qtableview_p.h.
References QSpanCollection::spans.
Referenced by heightHintForIndex(), and widthHintForIndex().
int QTableViewPrivate::heightHintForIndex | ( | const QModelIndex & | index, |
int | hint, | ||
QStyleOptionViewItem & | option | ||
) | const |
Get sizeHint height for single Index (providing existing hint and style option)
Definition at line 1073 of file qtableview.cpp.
References QSet< T >::contains(), QPointer< T >::data(), QAbstractItemViewPrivate::editor(), QAbstractItemViewPrivate::editorForIndex(), hasSpans(), QSize::height(), hint(), QWidget::maximumSize, QWidget::minimumSize, QAbstractItemViewPrivate::persistent, qBound(), qMax(), showGrid, QWidget::sizeHint, QSpanCollection::spanAt(), spans, visualSpanRect(), QEditorInfo::widget, QRect::width(), and QAbstractItemViewPrivate::wrapItemText.
void QTableViewPrivate::init | ( | ) |
Definition at line 574 of file qtableview.cpp.
References QAbstractItemView::AnyKeyPressed, QObject::connect(), QAbstractItemViewPrivate::editTriggers, Qt::Horizontal, Qt::NoFocus, QAbstractItemViewPrivate::selectAll(), QHeaderView::setHighlightSections(), QHeaderView::setSectionsClickable(), SIGNAL, SLOT, QAbstractItemViewPrivate::tabKeyNavigation, and Qt::Vertical.
|
overridevirtual |
Reimplemented from QAbstractItemViewPrivate.
Definition at line 637 of file qtableview.cpp.
References QModelIndex::column(), horizontalHeader, i, QRect::isNull(), rect, ret, QModelIndex::row(), QHeaderView::sectionSize(), QHeaderView::sectionsMoved(), QHeaderView::sectionViewportPosition(), and verticalHeader.
|
inline |
Definition at line 200 of file qtableview_p.h.
References QAbstractTableModel::index(), and model.
Referenced by nextActiveVisualColumn(), and nextActiveVisualRow().
|
inline |
Definition at line 197 of file qtableview_p.h.
References QHeaderView::isSectionHidden().
Referenced by nextActiveVisualColumn().
|
inline |
Definition at line 120 of file qtableview_p.h.
|
inline |
Definition at line 194 of file qtableview_p.h.
References QHeaderView::isSectionHidden().
Referenced by nextActiveVisualRow().
|
inline |
Definition at line 133 of file qtableview_p.h.
Referenced by drawAndClipSpans(), nextActiveVisualColumn(), nextActiveVisualRow(), and widthHintForIndex().
|
inline |
Definition at line 130 of file qtableview_p.h.
Referenced by drawAndClipSpans(), nextActiveVisualColumn(), and nextActiveVisualRow().
int QTableViewPrivate::nextActiveVisualColumn | ( | int | row, |
int | columnToStart, | ||
int | limit, | ||
SearchDirection | searchDirection | ||
) | const |
Searches for the next cell which is available for e.g. keyboard navigation The search is done by column
Definition at line 817 of file qtableview.cpp.
References Decreasing, Increasing, isCellEnabled(), isColumnHidden(), logicalColumn(), logicalRow(), and visualColumn().
int QTableViewPrivate::nextActiveVisualRow | ( | int | rowToStart, |
int | column, | ||
int | limit, | ||
SearchDirection | searchDirection | ||
) | const |
Searches for the next cell which is available for e.g. keyboard navigation The search is done by row
Definition at line 785 of file qtableview.cpp.
References Decreasing, Increasing, isCellEnabled(), isRowHidden(), logicalColumn(), logicalRow(), and visualRow().
|
inline |
Definition at line 172 of file qtableview_p.h.
Referenced by setSpan().
|
inline |
Definition at line 187 of file qtableview_p.h.
|
inline |
Definition at line 181 of file qtableview_p.h.
Referenced by visualSpanRect().
int QTableViewPrivate::sectionSpanEndLogical | ( | const QHeaderView * | header, |
int | logical, | ||
int | span | ||
) | const |
Returns the logical index of the last section that's part of the span.
Definition at line 733 of file qtableview.cpp.
References QString::count(), header(), and i.
Referenced by sectionSpanSize().
int QTableViewPrivate::sectionSpanSize | ( | const QHeaderView * | header, |
int | logical, | ||
int | span | ||
) | const |
Returns the size of the span starting at logical index logical and spanning span sections.
Definition at line 750 of file qtableview.cpp.
References header(), and sectionSpanEndLogical().
void QTableViewPrivate::selectColumn | ( | int | column, |
bool | anchor | ||
) |
Definition at line 3434 of file qtableview.cpp.
References QPersistentModelIndex::column(), QItemSelectionModel::Columns, QListSpecialMethodsBase< T >::contains(), QAbstractItemViewPrivate::ctrlDragSelectionFlag, QItemSelectionModel::Current, QAbstractItemViewPrivate::currentSelectionStartIndex, QItemSelectionModel::Deselect, horizontalHeader, QAbstractItemModel::index(), QHeaderView::logicalIndexAt(), QAbstractItemViewPrivate::model, QItemSelectionModel::NoUpdate, qMax(), qMin(), QAbstractItemViewPrivate::root, QHeaderView::sectionsMoved(), QItemSelectionModel::Select, QItemSelectionModel::select(), QItemSelectionModel::selectedColumns(), QAbstractItemView::selectionModel(), QAbstractItemViewPrivate::selectionModel, QAbstractItemView::SelectItems, QAbstractItemView::SelectRows, QItemSelectionModel::setCurrentIndex(), QAbstractItemView::SingleSelection, QItemSelectionModel::Toggle, and verticalHeader.
Referenced by _q_selectColumn().
void QTableViewPrivate::selectRow | ( | int | row, |
bool | anchor | ||
) |
Definition at line 3394 of file qtableview.cpp.
References QListSpecialMethodsBase< T >::contains(), QAbstractItemViewPrivate::ctrlDragSelectionFlag, QItemSelectionModel::Current, QAbstractItemViewPrivate::currentSelectionStartIndex, QItemSelectionModel::Deselect, horizontalHeader, QAbstractItemModel::index(), QHeaderView::logicalIndexAt(), QAbstractItemViewPrivate::model, QItemSelectionModel::NoUpdate, qMax(), qMin(), QAbstractItemViewPrivate::root, QPersistentModelIndex::row(), QModelIndex::row(), QItemSelectionModel::Rows, QHeaderView::sectionsMoved(), QItemSelectionModel::Select, QItemSelectionModel::select(), QAbstractItemView::SelectColumns, QItemSelectionModel::selectedRows(), QAbstractItemView::selectionModel(), QAbstractItemViewPrivate::selectionModel, QAbstractItemView::SelectItems, QItemSelectionModel::setCurrentIndex(), QAbstractItemView::SingleSelection, QItemSelectionModel::Toggle, verticalHeader, and viewport().
Referenced by _q_selectRow().
void QTableViewPrivate::setSpan | ( | int | row, |
int | column, | ||
int | rowSpan, | ||
int | columnSpan | ||
) |
Sets the span for the cell at (row, column).
Definition at line 687 of file qtableview.cpp.
References QSpanCollection::addSpan(), columnSpan(), Q_UNLIKELY, qWarning, rowSpan(), sp, QSpanCollection::spanAt(), spans, and QSpanCollection::updateSpan().
QSpanCollection::Span QTableViewPrivate::span | ( | int | row, |
int | column | ||
) | const |
Gets the span information for the cell at (row, column).
Definition at line 720 of file qtableview.cpp.
References sp, QSpanCollection::spanAt(), and spans.
bool QTableViewPrivate::spanContainsSection | ( | const QHeaderView * | header, |
int | logical, | ||
int | spanLogical, | ||
int | span | ||
) | const |
Returns true
if the section at logical index logical is part of the span starting at logical index spanLogical and spanning span sections; otherwise, returns false
.
Definition at line 764 of file qtableview.cpp.
References QString::count(), header(), and i.
void QTableViewPrivate::trimHiddenSelections | ( | QItemSelectionRange * | range | ) | const |
Trims away indices that are hidden in the treeview due to hidden horizontal or vertical sections.
Definition at line 603 of file qtableview.cpp.
References horizontalHeader, QAbstractItemModel::index(), QHeaderView::isSectionHidden(), QAbstractItemViewPrivate::model, Q_ASSERT, and verticalHeader.
|
inline |
Definition at line 127 of file qtableview_p.h.
Referenced by drawAndClipSpans(), nextActiveVisualColumn(), and widthHintForIndex().
|
inline |
Definition at line 124 of file qtableview_p.h.
Referenced by drawAndClipSpans(), and nextActiveVisualRow().
QRect QTableViewPrivate::visualSpanRect | ( | const QSpanCollection::Span & | span | ) | const |
Returns the visual rect for the given span.
Definition at line 844 of file qtableview.cpp.
References columnSpanWidth(), horizontalHeader, i, rowSpanHeight(), QHeaderView::sectionViewportPosition(), showGrid, and verticalHeader.
Referenced by drawAndClipSpans(), and heightHintForIndex().
int QTableViewPrivate::widthHintForIndex | ( | const QModelIndex & | index, |
int | hint, | ||
const QStyleOptionViewItem & | option | ||
) | const |
Get sizeHint width for single Index (providing existing hint and style option)
Definition at line 1043 of file qtableview.cpp.
References QSet< T >::contains(), QPointer< T >::data(), QAbstractItemViewPrivate::editor(), QAbstractItemViewPrivate::editorForIndex(), hasSpans(), hint(), i, logicalColumn(), QWidget::maximumSize, QWidget::minimumSize, QAbstractItemViewPrivate::persistent, qBound(), qMax(), QWidget::sizeHint, QSpanCollection::spanAt(), spans, visualColumn(), QEditorInfo::widget, and QSize::width().
int QTableViewPrivate::columnResizeTimerID |
Definition at line 155 of file qtableview_p.h.
QList<int> QTableViewPrivate::columnsToUpdate |
Definition at line 157 of file qtableview_p.h.
bool QTableViewPrivate::geometryRecursionBlock |
Definition at line 165 of file qtableview_p.h.
Qt::PenStyle QTableViewPrivate::gridStyle |
Definition at line 154 of file qtableview_p.h.
QHeaderView* QTableViewPrivate::horizontalHeader |
Definition at line 159 of file qtableview_p.h.
Referenced by QTableWidgetPrivate::_q_dataChanged(), QTableWidgetPrivate::_q_sort(), drawAndClipSpans(), intersectedRect(), selectColumn(), selectRow(), trimHiddenSelections(), and visualSpanRect().
int QTableViewPrivate::rowResizeTimerID |
Definition at line 156 of file qtableview_p.h.
QList<int> QTableViewPrivate::rowsToUpdate |
Definition at line 158 of file qtableview_p.h.
bool QTableViewPrivate::showGrid |
Definition at line 153 of file qtableview_p.h.
Referenced by drawAndClipSpans(), heightHintForIndex(), and visualSpanRect().
bool QTableViewPrivate::sortingEnabled |
Definition at line 164 of file qtableview_p.h.
Referenced by QTableWidgetPrivate::_q_dataChanged(), and QTableWidgetPrivate::_q_sort().
QSpanCollection QTableViewPrivate::spans |
Definition at line 168 of file qtableview_p.h.
Referenced by _q_updateSpanInsertedColumns(), _q_updateSpanInsertedRows(), _q_updateSpanRemovedColumns(), _q_updateSpanRemovedRows(), drawAndClipSpans(), heightHintForIndex(), setSpan(), span(), and widthHintForIndex().
QHeaderView* QTableViewPrivate::verticalHeader |
Definition at line 160 of file qtableview_p.h.
Referenced by drawAndClipSpans(), intersectedRect(), selectColumn(), selectRow(), trimHiddenSelections(), and visualSpanRect().
QPoint QTableViewPrivate::visualCursor |
Definition at line 166 of file qtableview_p.h.