![]() |
Qt 6.x
The Qt SDK
|
#include <qtreeview_p.h>
Definition at line 47 of file qtreeview_p.h.
|
inline |
Definition at line 52 of file qtreeview_p.h.
|
inline |
Definition at line 63 of file qtreeview_p.h.
|
overridevirtual |
This slot is called when columns are about to be removed. The deleted columns are those under the given parent from start to end inclusive.
Reimplemented from QAbstractItemViewPrivate.
Definition at line 3293 of file qtreeview.cpp.
References QAbstractItemViewPrivate::_q_columnsAboutToBeRemoved(), QList< T >::clear(), parent, and viewItems.
|
overridevirtual |
This slot is called when columns have been removed. The deleted rows are those under the given parent from start to end inclusive.
Reimplemented from QAbstractItemViewPrivate.
Definition at line 3300 of file qtreeview.cpp.
References QAbstractItemViewPrivate::_q_columnsRemoved(), QAbstractItemViewPrivate::doDelayedItemsLayout(), and parent.
void QTreeViewPrivate::_q_modelAboutToBeReset | ( | ) |
Definition at line 3288 of file qtreeview.cpp.
References QList< T >::clear(), and viewItems.
|
overridevirtual |
Reimplemented from QAbstractItemViewPrivate.
Definition at line 1371 of file qtreeview.cpp.
References QAbstractItemViewPrivate::_q_modelDestroyed(), QList< T >::clear(), and viewItems.
void QTreeViewPrivate::_q_sortIndicatorChanged | ( | int | column, |
Qt::SortOrder | order | ||
) |
Definition at line 3977 of file qtreeview.cpp.
References QAbstractItemViewPrivate::model.
|
inline |
Definition at line 205 of file qtreeview_p.h.
|
inline |
Definition at line 212 of file qtreeview_p.h.
References QSqlQueryModel::columnCount(), header(), and model.
int QTreeViewPrivate::accessibleTree2Index | ( | const QModelIndex & | index | ) | const |
Definition at line 3982 of file qtreeview.cpp.
|
overridevirtual |
Reimplemented from QAbstractItemViewPrivate.
Definition at line 1417 of file qtreeview.cpp.
References QList< T >::at(), calcLogicalIndices(), QHeaderView::count(), current, QTreeViewItem::expanded, QTreeViewItem::hasChildren, QTreeViewItem::hasMoreSiblings, header, QListSpecialMethodsBase< T >::indexOf(), QAbstractItemViewPrivate::selectionBehavior, QAbstractItemView::SelectRows, QTreeViewItem::spanning, spanning, QStyle::State_Children, QStyle::State_None, QStyle::State_Open, QStyle::State_Sibling, viewIndex(), viewItems, and QHeaderView::visualIndex().
|
inline |
Definition at line 207 of file qtreeview_p.h.
References i, item, and QList< T >::size().
void QTreeViewPrivate::calcLogicalIndices | ( | QList< int > * | logicalIndices, |
QList< QStyleOptionViewItem::ViewItemPosition > * | itemPositions, | ||
int | left, | ||
int | right | ||
) | const |
Definition at line 1530 of file qtreeview.cpp.
References QList< T >::append(), QList< T >::at(), QHeaderView::count(), header, QHeaderView::isSectionHidden(), isTreePosition(), QHeaderView::logicalIndex(), pos, QList< T >::resize(), QList< T >::size(), and spanning.
Referenced by adjustViewOptionsForIndex().
void QTreeViewPrivate::collapse | ( | int | item, |
bool | emitSignal | ||
) |
Definition at line 3134 of file qtreeview.cpp.
References QAbstractItemView::AnimatingState, animationsEnabled, QList< T >::at(), QAbstractAnimation::Backward, QAbstractItemView::CollapsingState, QAbstractItemViewPrivate::delayedAutoScroll, emit, QSet< T >::end(), QSet< T >::erase(), QTreeViewItem::expanded, expandedIndexes, QSet< T >::find(), QTreeViewItem::index, QSet< T >::isEmpty(), QAbstractItemViewPrivate::isPersistent(), it, item, modelIndex(), removeViewItems(), QAbstractItemViewPrivate::state, QAbstractItemViewPrivate::stateBeforeAnimation, QBasicTimer::stop(), QTreeViewItem::total, and viewItems.
Referenced by expandOrCollapseItemAtPos().
int QTreeViewPrivate::columnAt | ( | int | x | ) | const |
Definition at line 3706 of file qtreeview.cpp.
References header, and QHeaderView::logicalIndexAt().
QList< QPair< int, int > > QTreeViewPrivate::columnRanges | ( | const QModelIndex & | topIndex, |
const QModelIndex & | bottomIndex | ||
) | const |
Definition at line 3834 of file qtreeview.cpp.
References QList< T >::at(), QList< T >::begin(), QModelIndex::column(), current, QList< T >::end(), header, i, QHeaderView::isSectionHidden(), QHeaderView::logicalIndex(), qMax(), qMin(), ret, QList< T >::size(), and QHeaderView::visualIndex().
Referenced by select().
int QTreeViewPrivate::coordinateForItem | ( | int | item | ) | const |
Returns the viewport y coordinate for item.
Definition at line 3504 of file qtreeview.cpp.
References defaultItemHeight, i, item, itemHeight(), Q_ASSERT, QAbstractItemView::ScrollPerPixel, QList< T >::size(), uniformRowHeights, QAbstractItemViewPrivate::verticalScrollMode, and viewItems.
Referenced by itemDecorationRect(), pageDown(), and pageUp().
|
overridevirtual |
\reimp
We have a QTreeView way of knowing what elements are on the viewport
Reimplemented from QAbstractItemViewPrivate.
Definition at line 1402 of file qtreeview.cpp.
References QAbstractItemViewPrivate::draggablePaintPairs(), QSet< T >::isEmpty(), list, Q_ASSERT, and spanningIndexes.
void QTreeViewPrivate::expand | ( | int | item, |
bool | emitSignal | ||
) |
Definition at line 3067 of file qtreeview.cpp.
References QAbstractItemView::AnimatingState, animationsEnabled, QList< T >::at(), QAbstractItemModel::canFetchMore(), emit, QTreeViewItem::expanded, QAbstractItemView::ExpandingState, QAbstractItemModel::fetchMore(), QAbstractAnimation::Forward, QTreeViewItem::index, item, Qt::ItemNeverHasChildren, layout, QAbstractItemViewPrivate::model, QAbstractItemViewPrivate::state, QAbstractItemViewPrivate::stateBeforeAnimation, storeExpanded(), and viewItems.
Referenced by expandOrCollapseItemAtPos().
bool QTreeViewPrivate::expandOrCollapseItemAtPos | ( | const QPoint & | pos | ) |
Definition at line 1347 of file qtreeview.cpp.
References QList< T >::at(), collapse(), QAbstractItemView::EditingState, expand(), QTreeViewItem::expanded, hasVisibleChildren(), i, QTreeViewItem::index, QAbstractItemViewPrivate::isAnimating(), itemDecorationAt(), itemsExpandable, QAbstractItemView::NoState, pos, QAbstractItemViewPrivate::state, viewItems, and viewport().
int QTreeViewPrivate::firstVisibleItem | ( | int * | offset = nullptr | ) | const |
Definition at line 3659 of file qtreeview.cpp.
References defaultItemHeight, i, itemHeight(), QAbstractItemView::ScrollPerItem, QList< T >::size(), uniformRowHeights, QAbstractItemViewPrivate::verticalScrollMode, and viewItems.
Referenced by lastVisibleItem().
bool QTreeViewPrivate::hasVisibleChildren | ( | const QModelIndex & | parent | ) | const |
Definition at line 3956 of file qtreeview.cpp.
References QAbstractItemModel::hasChildren(), hiddenIndexes, i, QSet< T >::isEmpty(), Qt::ItemNeverHasChildren, QAbstractItemViewPrivate::model, parent, and QAbstractItemModel::rowCount().
Referenced by expandOrCollapseItemAtPos(), and itemDecorationRect().
int QTreeViewPrivate::indentationForItem | ( | int | item | ) | const |
Definition at line 3471 of file qtreeview.cpp.
References QList< T >::at(), indent, item, QTreeViewItem::level, rootDecoration, QList< T >::size(), and viewItems.
Referenced by itemDecorationRect(), and widthHintForIndex().
void QTreeViewPrivate::initialize | ( | ) |
Definition at line 3045 of file qtreeview.cpp.
References Qt::AlignLeft, Qt::AlignVCenter, animationsEnabled, QObject::connect(), header, Qt::Horizontal, QAbstractItemView::ScrollPerPixel, QAbstractItemView::SelectRows, QHeaderView::setDefaultAlignment(), QHeaderView::setSectionsMovable(), QHeaderView::setStretchLastSection(), QStyle::SH_Widget_Animation_Duration, SIGNAL, QAbstractItemView::SingleSelection, SLOT, updateIndentationFromStyle(), and Qt::WA_MacShowFocusRect.
void QTreeViewPrivate::insertViewItems | ( | int | pos, |
int | count, | ||
const QTreeViewItem & | viewItem | ||
) |
Definition at line 3101 of file qtreeview.cpp.
References QList< T >::data(), i, QList< T >::insert(), items, pos, QList< T >::size(), and viewItems.
|
overridevirtual |
Reimplemented from QAbstractItemViewPrivate.
Definition at line 1379 of file qtreeview.cpp.
References QModelIndex::column(), QAbstractItemViewPrivate::executePostedLayout(), QAbstractItemModel::index(), isRowHidden(), QAbstractItemViewPrivate::model, QModelIndex::parent(), rect, and QModelIndex::row().
|
inline |
Definition at line 209 of file qtreeview_p.h.
References item.
|
inline |
Definition at line 183 of file qtreeview_p.h.
References QSet< T >::contains(), QModelIndex::flags(), QAbstractItemViewPrivate::isPersistent(), and Qt::ItemNeverHasChildren.
|
inline |
Definition at line 198 of file qtreeview_p.h.
References QList< T >::at(), i, QAbstractItemViewPrivate::isIndexEnabled(), and QList< T >::size().
Referenced by itemForKeyEnd(), itemForKeyHome(), pageDown(), and pageUp().
|
inline |
Definition at line 191 of file qtreeview_p.h.
References QSet< T >::contains(), QSet< T >::isEmpty(), and QAbstractItemViewPrivate::isPersistent().
Referenced by intersectedRect().
|
inline |
Definition at line 66 of file qtreeview_p.h.
Referenced by calcLogicalIndices(), itemDecorationAt(), and widthHintForIndex().
int QTreeViewPrivate::itemAtCoordinate | ( | int | coordinate | ) | const |
Returns the index of the view item at the given viewport coordinate.
Definition at line 3555 of file qtreeview.cpp.
References defaultItemHeight, itemHeight(), QAbstractItemView::ScrollPerPixel, QList< T >::size(), uniformRowHeights, QAbstractItemViewPrivate::verticalScrollMode, and viewItems.
Referenced by itemDecorationAt(), pageDown(), and pageUp().
int QTreeViewPrivate::itemDecorationAt | ( | const QPoint & | pos | ) | const |
Definition at line 3785 of file qtreeview.cpp.
References QRect::contains(), QAbstractItemViewPrivate::executePostedLayout(), header, QSet< T >::isEmpty(), isTreePosition(), itemAtCoordinate(), itemDecorationRect(), QHeaderView::logicalIndexAt(), modelIndex(), pos, and spanningIndexes.
Referenced by expandOrCollapseItemAtPos().
QRect QTreeViewPrivate::itemDecorationRect | ( | const QModelIndex & | index | ) | const |
Definition at line 3807 of file qtreeview.cpp.
References QList< T >::at(), coordinateForItem(), hasVisibleChildren(), header, indent, indentationForItem(), QTreeViewItem::index, QStyleOption::initFrom(), itemHeight(), logicalIndexForTree(), opt, position(), rect, QStyleOption::rect, QAbstractItemViewPrivate::root, rootDecoration, QStyle::SE_TreeViewDisclosureItem, QHeaderView::sectionSize(), QHeaderView::sectionViewportPosition(), viewIndex(), and viewItems.
Referenced by itemDecorationAt().
int QTreeViewPrivate::itemForKeyEnd | ( | ) | const |
Definition at line 3463 of file qtreeview.cpp.
References isItemHiddenOrDisabled(), QList< T >::size(), and viewItems.
int QTreeViewPrivate::itemForKeyHome | ( | ) | const |
Definition at line 3455 of file qtreeview.cpp.
References isItemHiddenOrDisabled(), QList< T >::size(), and viewItems.
int QTreeViewPrivate::itemHeight | ( | int | item | ) | const |
Definition at line 3481 of file qtreeview.cpp.
References QList< T >::at(), defaultItemHeight, QTreeViewItem::height, QTreeViewItem::index, QList< T >::isEmpty(), item, Q_ASSERT, qMax(), QList< T >::size(), uniformRowHeights, and viewItems.
Referenced by coordinateForItem(), firstVisibleItem(), itemAtCoordinate(), itemDecorationRect(), lastVisibleItem(), and updateScrollBars().
int QTreeViewPrivate::lastVisibleItem | ( | int | firstVisual = -1 , |
int | offset = -1 |
||
) | const |
Definition at line 3688 of file qtreeview.cpp.
References firstVisibleItem(), i, itemHeight(), QAbstractItemViewPrivate::offset(), QList< T >::size(), viewItems, and viewport().
void QTreeViewPrivate::layout | ( | int | i, |
bool | recursiveExpanding = false , |
||
bool | afterIsUninitialized = false |
||
) |
creates and initialize the viewItem structure of the children of the element
set recursiveExpanding if the function has to expand all the children (called from expandAll) afterIsUninitialized is when we recurse from layout(-1), it means all the items after 'i' are not yet initialized and need not to be moved
Definition at line 3314 of file qtreeview.cpp.
References current, i, modelIndex(), parent, qScopeGuard(), QAbstractItemViewPrivate::root, QList< T >::size(), and viewItems.
int QTreeViewPrivate::logicalIndexForTree | ( | ) | const |
Definition at line 1319 of file qtreeview.cpp.
References header, QHeaderView::logicalIndex(), and treePosition.
Referenced by itemDecorationRect().
QModelIndex QTreeViewPrivate::modelIndex | ( | int | i, |
int | column = 0 |
||
) | const |
Definition at line 3648 of file qtreeview.cpp.
References QList< T >::at(), i, QTreeViewItem::index, ret, QList< T >::size(), and viewItems.
Referenced by collapse(), itemDecorationAt(), layout(), and select().
int QTreeViewPrivate::pageDown | ( | int | item | ) | const |
Definition at line 3443 of file qtreeview.cpp.
References coordinateForItem(), i, isItemHiddenOrDisabled(), itemAtCoordinate(), QList< T >::size(), viewItems, and viewport().
int QTreeViewPrivate::pageUp | ( | int | item | ) | const |
Definition at line 3431 of file qtreeview.cpp.
References coordinateForItem(), i, isItemHiddenOrDisabled(), itemAtCoordinate(), QList< T >::size(), viewItems, and viewport().
void QTreeViewPrivate::paintAlternatingRowColors | ( | QPainter * | painter, |
QStyleOptionViewItem * | option, | ||
int | y, | ||
int | bottom | ||
) | const |
Definition at line 1327 of file qtreeview.cpp.
References QAbstractItemViewPrivate::alternatingColors, current, defaultItemHeight, QSize::height(), QAbstractItemViewPrivate::itemDelegate, painter, QStyle::PE_PanelItemViewRow, QStyle::SH_ItemView_PaintAlternatingRowColorsForEmptyArea, QAbstractItemDelegate::sizeHint(), and viewport().
void QTreeViewPrivate::removeViewItems | ( | int | pos, |
int | count | ||
) |
Definition at line 3110 of file qtreeview.cpp.
References QList< T >::data(), i, items, pos, QList< T >::remove(), QList< T >::size(), and viewItems.
Referenced by collapse().
void QTreeViewPrivate::select | ( | const QModelIndex & | start, |
const QModelIndex & | stop, | ||
QItemSelectionModel::SelectionFlags | command | ||
) |
Definition at line 3881 of file qtreeview.cpp.
References QList< T >::append(), QList< T >::at(), QList< T >::begin(), QItemSelectionRange::bottomRight(), columnRanges(), QList< T >::end(), i, QAbstractItemModel::index(), QList< T >::isEmpty(), QItemSelectionRange::isValid(), QModelIndex::isValid(), it, QItemSelectionRange::left(), QAbstractItemViewPrivate::model, modelIndex(), QModelIndex::parent(), QItemSelectionRange::parent(), parent, QStack< T >::pop(), QStack< T >::push(), qAbs(), QModelIndex::row(), selection, QModelIndex::sibling(), QList< T >::size(), QItemSelectionRange::top(), and viewIndex().
Definition at line 3941 of file qtreeview.cpp.
References QHeaderView::count(), header, qMakePair(), qMax(), qMin(), rect, and QHeaderView::visualIndexAt().
|
inline |
Definition at line 176 of file qtreeview_p.h.
References QSet< T >::contains(), and QSet< T >::insert().
Referenced by expand().
void QTreeViewPrivate::updateChildCount | ( | const int | parentItem, |
const int | delta | ||
) |
void QTreeViewPrivate::updateIndentationFromStyle | ( | ) |
Definition at line 3990 of file qtreeview.cpp.
References indent, and QStyle::PM_TreeViewIndentation.
Referenced by initialize().
void QTreeViewPrivate::updateScrollBars | ( | ) |
Definition at line 3711 of file qtreeview.cpp.
References QHeaderView::count(), defaultItemHeight, QAbstractItemViewPrivate::executePostedLayout(), header, QSize::height(), QAbstractItemViewPrivate::horizontalScrollMode, i, QList< T >::isEmpty(), QSize::isValid(), item, itemHeight(), QHeaderView::length(), QHeaderView::logicalIndex(), qMax(), QAbstractItemView::ScrollPerItem, QHeaderView::sectionSize(), QList< T >::size(), uniformRowHeights, QAbstractItemViewPrivate::verticalScrollMode, viewItems, viewport(), and QSize::width().
int QTreeViewPrivate::viewIndex | ( | const QModelIndex & | index | ) | const |
Definition at line 3604 of file qtreeview.cpp.
References QList< T >::at(), i, QTreeViewItem::index, QModelIndex::internalId(), QList< T >::isEmpty(), QModelIndex::isValid(), j, lastViewedItem, qMax(), qMin(), QModelIndex::row(), QModelIndex::sibling(), QList< T >::size(), and viewItems.
Referenced by adjustViewOptionsForIndex(), itemDecorationRect(), and select().
int QTreeViewPrivate::widthHintForIndex | ( | const QModelIndex & | index, |
int | hint, | ||
const QStyleOptionViewItem & | option, | ||
int | i | ||
) | const |
Get sizeHint width for single index (providing existing hint and style option) and index in viewIndex i.
Definition at line 1586 of file qtreeview.cpp.
References QSet< T >::contains(), QPointer< T >::data(), QAbstractItemViewPrivate::editor(), QAbstractItemViewPrivate::editorForIndex(), hint(), i, indentationForItem(), isTreePosition(), QWidget::maximumSize, QWidget::minimumSize, QAbstractItemViewPrivate::persistent, qBound(), qMax(), QWidget::sizeHint, QEditorInfo::widget, and QSize::width().
bool QTreeViewPrivate::allColumnsShowFocus |
Definition at line 164 of file qtreeview_p.h.
bool QTreeViewPrivate::animationsEnabled |
Definition at line 174 of file qtreeview_p.h.
Referenced by collapse(), expand(), and initialize().
int QTreeViewPrivate::autoExpandDelay |
Definition at line 228 of file qtreeview_p.h.
int QTreeViewPrivate::columnResizeTimerID |
Definition at line 224 of file qtreeview_p.h.
QList<int> QTreeViewPrivate::columnsToUpdate |
Definition at line 225 of file qtreeview_p.h.
|
mutable |
Definition at line 169 of file qtreeview_p.h.
Referenced by QTreeWidgetPrivate::_q_emitCurrentItemChanged(), adjustViewOptionsForIndex(), columnRanges(), layout(), and paintAlternatingRowColors().
bool QTreeViewPrivate::customIndent |
Definition at line 165 of file qtreeview_p.h.
int QTreeViewPrivate::defaultItemHeight |
Definition at line 158 of file qtreeview_p.h.
Referenced by coordinateForItem(), firstVisibleItem(), itemAtCoordinate(), itemHeight(), paintAlternatingRowColors(), and updateScrollBars().
QSet<QPersistentModelIndex> QTreeViewPrivate::expandedIndexes |
Definition at line 173 of file qtreeview_p.h.
Referenced by collapse().
bool QTreeViewPrivate::expandsOnDoubleClick |
Definition at line 163 of file qtreeview_p.h.
bool QTreeViewPrivate::geometryRecursionBlock |
Definition at line 235 of file qtreeview_p.h.
bool QTreeViewPrivate::hasRemovedItems |
Definition at line 238 of file qtreeview_p.h.
QHeaderView* QTreeViewPrivate::header |
Definition at line 153 of file qtreeview_p.h.
Referenced by QTreeWidgetPrivate::_q_dataChanged(), QTreeWidgetPrivate::_q_sort(), adjustViewOptionsForIndex(), calcLogicalIndices(), columnAt(), columnRanges(), initialize(), itemDecorationAt(), itemDecorationRect(), logicalIndexForTree(), startAndEndColumns(), and updateScrollBars().
QSet<QPersistentModelIndex> QTreeViewPrivate::hiddenIndexes |
Definition at line 189 of file qtreeview_p.h.
Referenced by hasVisibleChildren().
|
mutable |
Definition at line 232 of file qtreeview_p.h.
int QTreeViewPrivate::indent |
Definition at line 154 of file qtreeview_p.h.
Referenced by indentationForItem(), itemDecorationRect(), and updateIndentationFromStyle().
bool QTreeViewPrivate::itemsExpandable |
Definition at line 161 of file qtreeview_p.h.
Referenced by expandOrCollapseItemAtPos().
|
mutable |
Definition at line 157 of file qtreeview_p.h.
Referenced by viewIndex().
|
mutable |
Definition at line 168 of file qtreeview_p.h.
QBasicTimer QTreeViewPrivate::openTimer |
Definition at line 229 of file qtreeview_p.h.
bool QTreeViewPrivate::rootDecoration |
Definition at line 160 of file qtreeview_p.h.
Referenced by indentationForItem(), and itemDecorationRect().
bool QTreeViewPrivate::sortingEnabled |
Definition at line 162 of file qtreeview_p.h.
Referenced by QTreeWidgetPrivate::_q_dataChanged(), and QTreeWidgetPrivate::_q_sort().
|
mutable |
Definition at line 170 of file qtreeview_p.h.
Referenced by adjustViewOptionsForIndex(), and calcLogicalIndices().
QSet<QPersistentModelIndex> QTreeViewPrivate::spanningIndexes |
Definition at line 221 of file qtreeview_p.h.
Referenced by draggablePaintPairs(), and itemDecorationAt().
int QTreeViewPrivate::treePosition |
Definition at line 241 of file qtreeview_p.h.
Referenced by logicalIndexForTree().
bool QTreeViewPrivate::uniformRowHeights |
Definition at line 159 of file qtreeview_p.h.
Referenced by coordinateForItem(), firstVisibleItem(), itemAtCoordinate(), itemHeight(), and updateScrollBars().
|
mutable |
Definition at line 156 of file qtreeview_p.h.
Referenced by _q_columnsAboutToBeRemoved(), _q_modelAboutToBeReset(), _q_modelDestroyed(), adjustViewOptionsForIndex(), collapse(), coordinateForItem(), expand(), expandOrCollapseItemAtPos(), firstVisibleItem(), indentationForItem(), insertViewItems(), itemAtCoordinate(), itemDecorationRect(), itemForKeyEnd(), itemForKeyHome(), itemHeight(), lastVisibleItem(), layout(), modelIndex(), pageDown(), pageUp(), removeViewItems(), updateScrollBars(), and viewIndex().