Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include <qtableview_p.h>
Public Types | |
enum class | SearchDirection { Increasing , Decreasing } |
Definition at line 104 of file qtableview_p.h.
|
strong |
Enumerator | |
---|---|
Increasing | |
Decreasing |
Definition at line 216 of file qtableview_p.h.
|
inline |
Definition at line 108 of file qtableview_p.h.
|
inline |
Definition at line 142 of file qtableview_p.h.
void QTableViewPrivate::clearConnections | ( | ) |
Definition at line 602 of file qtableview.cpp.
References connection, QObject::disconnect(), dynHorHeaderConnections, horHeaderConnections, modelConnections, selectionmodelConnection, and verHeaderConnections.
|
inline |
Definition at line 187 of file qtableview_p.h.
Referenced by setSpan().
|
inline |
Definition at line 202 of file qtableview_p.h.
|
inline |
Definition at line 196 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 889 of file qtableview.cpp.
References QAbstractItemViewPrivate::alternatingColors, area(), drawCell(), QStyleOptionButton::features, horizontalHeader, QAbstractItemModel::index(), logicalColumn(), logicalRow(), QAbstractItemViewPrivate::model, opt, painter, rect, QStyleOption::rect, QAbstractItemViewPrivate::root, QAbstractItemViewPrivate::scrollDelayOffset, QHeaderView::sectionsMoved(), 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 1027 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 190 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 1092 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 575 of file qtableview.cpp.
References QAbstractItemView::AnyKeyPressed, QObject::connect(), QAbstractItemViewPrivate::editTriggers, Qt::Horizontal, Qt::NoFocus, QAbstractItemView::selectAll(), QHeaderView::setHighlightSections(), QHeaderView::setSectionsClickable(), QAbstractItemViewPrivate::tabKeyNavigation, and Qt::Vertical.
|
overridevirtual |
Reimplemented from QAbstractItemViewPrivate.
Definition at line 656 of file qtableview.cpp.
References QModelIndex::column(), horizontalHeader, i, QRect::intersected(), QRect::isNull(), rect, ret, QModelIndex::row(), QHeaderView::sectionSize(), QHeaderView::sectionsMoved(), QHeaderView::sectionViewportPosition(), and verticalHeader.
|
inline |
Definition at line 212 of file qtableview_p.h.
References QAbstractTableModel::index(), and model.
Referenced by nextActiveVisualColumn(), and nextActiveVisualRow().
|
inline |
Definition at line 209 of file qtableview_p.h.
References QHeaderView::isSectionHidden().
Referenced by nextActiveVisualColumn().
|
inline |
Definition at line 125 of file qtableview_p.h.
|
inline |
Definition at line 206 of file qtableview_p.h.
References QHeaderView::isSectionHidden().
Referenced by nextActiveVisualRow().
|
inline |
Definition at line 138 of file qtableview_p.h.
Referenced by drawAndClipSpans(), nextActiveVisualColumn(), nextActiveVisualRow(), and widthHintForIndex().
|
inline |
Definition at line 135 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 836 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 804 of file qtableview.cpp.
References Decreasing, Increasing, isCellEnabled(), isRowHidden(), logicalColumn(), logicalRow(), and visualRow().
|
inline |
Definition at line 184 of file qtableview_p.h.
Referenced by setSpan().
|
inline |
Definition at line 199 of file qtableview_p.h.
|
inline |
Definition at line 193 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 752 of file qtableview.cpp.
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 769 of file qtableview.cpp.
References header(), and sectionSpanEndLogical().
void QTableViewPrivate::selectColumn | ( | int | column, |
bool | anchor ) |
Definition at line 3448 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.
void QTableViewPrivate::selectRow | ( | int | row, |
bool | anchor ) |
Definition at line 3408 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().
void QTableViewPrivate::setSpan | ( | int | row, |
int | column, | ||
int | rowSpan, | ||
int | columnSpan ) |
Sets the span for the cell at (row, column).
Definition at line 706 of file qtableview.cpp.
References QSpanCollection::addSpan(), columnSpan(), Q_UNLIKELY, qWarning, rowSpan(), sp, QSpanCollection::spanAt(), spans, and QSpanCollection::updateSpan().
void QTableViewPrivate::sortIndicatorChanged | ( | int | column, |
Qt::SortOrder | order ) |
Sort the model when the header sort indicator changed
Definition at line 1018 of file qtableview.cpp.
References QAbstractItemViewPrivate::model.
Referenced by QTableView::setSortingEnabled().
QSpanCollection::Span QTableViewPrivate::span | ( | int | row, |
int | column ) const |
Gets the span information for the cell at (row, column).
Definition at line 739 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 783 of file qtableview.cpp.
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 622 of file qtableview.cpp.
References horizontalHeader, QAbstractItemModel::index(), QHeaderView::isSectionHidden(), QAbstractItemViewPrivate::model, Q_ASSERT, and verticalHeader.
void QTableViewPrivate::updateSpanInsertedColumns | ( | const QModelIndex & | parent, |
int | start, | ||
int | end ) |
Updates spans after column insertion.
Definition at line 988 of file qtableview.cpp.
References Q_UNUSED, spans, and QSpanCollection::updateInsertedColumns().
Referenced by QTableView::setModel().
void QTableViewPrivate::updateSpanInsertedRows | ( | const QModelIndex & | parent, |
int | start, | ||
int | end ) |
Updates spans after row insertion.
Definition at line 978 of file qtableview.cpp.
References Q_UNUSED, spans, and QSpanCollection::updateInsertedRows().
Referenced by QTableView::setModel().
void QTableViewPrivate::updateSpanRemovedColumns | ( | const QModelIndex & | parent, |
int | start, | ||
int | end ) |
Updates spans after column removal.
Definition at line 1008 of file qtableview.cpp.
References Q_UNUSED, spans, and QSpanCollection::updateRemovedColumns().
Referenced by QTableView::setModel().
void QTableViewPrivate::updateSpanRemovedRows | ( | const QModelIndex & | parent, |
int | start, | ||
int | end ) |
Updates spans after row removal.
Definition at line 998 of file qtableview.cpp.
References Q_UNUSED, spans, and QSpanCollection::updateRemovedRows().
Referenced by QTableView::setModel().
|
inline |
Definition at line 132 of file qtableview_p.h.
Referenced by drawAndClipSpans(), nextActiveVisualColumn(), and widthHintForIndex().
|
inline |
Definition at line 129 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 863 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 1062 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 160 of file qtableview_p.h.
QList<int> QTableViewPrivate::columnsToUpdate |
Definition at line 162 of file qtableview_p.h.
std::vector<QMetaObject::Connection> QTableViewPrivate::dynHorHeaderConnections |
Definition at line 174 of file qtableview_p.h.
Referenced by clearConnections().
bool QTableViewPrivate::geometryRecursionBlock |
Definition at line 177 of file qtableview_p.h.
Qt::PenStyle QTableViewPrivate::gridStyle |
Definition at line 159 of file qtableview_p.h.
std::array<QMetaObject::Connection, 5> QTableViewPrivate::horHeaderConnections |
Definition at line 173 of file qtableview_p.h.
Referenced by clearConnections().
QHeaderView* QTableViewPrivate::horizontalHeader |
Definition at line 164 of file qtableview_p.h.
Referenced by QTableWidgetPrivate::dataChanged(), drawAndClipSpans(), intersectedRect(), selectColumn(), selectRow(), QTableWidgetPrivate::sort(), trimHiddenSelections(), and visualSpanRect().
std::array<QMetaObject::Connection, 4> QTableViewPrivate::modelConnections |
Definition at line 171 of file qtableview_p.h.
Referenced by clearConnections().
int QTableViewPrivate::rowResizeTimerID |
Definition at line 161 of file qtableview_p.h.
QList<int> QTableViewPrivate::rowsToUpdate |
Definition at line 163 of file qtableview_p.h.
QMetaObject::Connection QTableViewPrivate::selectionmodelConnection |
Definition at line 170 of file qtableview_p.h.
Referenced by clearConnections().
bool QTableViewPrivate::showGrid |
Definition at line 158 of file qtableview_p.h.
Referenced by drawAndClipSpans(), heightHintForIndex(), and visualSpanRect().
bool QTableViewPrivate::sortingEnabled |
Definition at line 176 of file qtableview_p.h.
Referenced by QTableWidgetPrivate::dataChanged(), and QTableWidgetPrivate::sort().
QSpanCollection QTableViewPrivate::spans |
Definition at line 180 of file qtableview_p.h.
Referenced by drawAndClipSpans(), heightHintForIndex(), setSpan(), span(), updateSpanInsertedColumns(), updateSpanInsertedRows(), updateSpanRemovedColumns(), updateSpanRemovedRows(), and widthHintForIndex().
std::array<QMetaObject::Connection, 7> QTableViewPrivate::verHeaderConnections |
Definition at line 172 of file qtableview_p.h.
Referenced by clearConnections().
QHeaderView* QTableViewPrivate::verticalHeader |
Definition at line 165 of file qtableview_p.h.
Referenced by drawAndClipSpans(), intersectedRect(), selectColumn(), selectRow(), trimHiddenSelections(), and visualSpanRect().
QPoint QTableViewPrivate::visualCursor |
Definition at line 178 of file qtableview_p.h.