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>.
Loading...
Searching...
No Matches
QTreeViewPrivate Class Reference

#include <qtreeview_p.h>

+ Inheritance diagram for QTreeViewPrivate:
+ Collaboration diagram for QTreeViewPrivate:

Public Types

enum  RectRule { FullRow , SingleSection , AddRowIndicatorToFirstSection }
 

Public Member Functions

 QTreeViewPrivate ()
 
 ~QTreeViewPrivate ()
 
void initialize ()
 
void clearConnections ()
 
int logicalIndexForTree () const
 
bool isTreePosition (int logicalIndex) const
 
QItemViewPaintPairs draggablePaintPairs (const QModelIndexList &indexes, QRect *r) const override
 \reimp
 
void adjustViewOptionsForIndex (QStyleOptionViewItem *option, const QModelIndex &current) const override
 
void expand (int item, bool emitSignal)
 
void collapse (int item, bool emitSignal)
 
void columnsAboutToBeRemoved (const QModelIndex &, int, int) override
 
void columnsRemoved (const QModelIndex &, int, int) override
 
void modelAboutToBeReset ()
 
void sortIndicatorChanged (int column, Qt::SortOrder order)
 
void modelDestroyed () override
 
QRect intersectedRect (const QRect rect, const QModelIndex &topLeft, const QModelIndex &bottomRight) const override
 
void layout (int item, bool recusiveExpanding=false, bool afterIsUninitialized=false)
 
int pageUp (int item) const
 
int pageDown (int item) const
 
int itemForKeyHome () const
 
int itemForKeyEnd () const
 
int itemHeight (int item) const
 
int indentationForItem (int item) const
 
int coordinateForItem (int item) const
 
int itemAtCoordinate (int coordinate) const
 
int viewIndex (const QModelIndex &index) const
 
QModelIndex modelIndex (int i, int column=0) const
 
void insertViewItems (int pos, int count, const QTreeViewItem &viewItem)
 
void removeViewItems (int pos, int count)
 
int firstVisibleItem (int *offset=nullptr) const
 
int lastVisibleItem (int firstVisual=-1, int offset=-1) const
 
int columnAt (int x) const
 
bool hasVisibleChildren (const QModelIndex &parent) const
 
bool expandOrCollapseItemAtPos (const QPoint &pos)
 
void updateScrollBars ()
 
int itemDecorationAt (const QPoint &pos) const
 
QRect itemDecorationRect (const QModelIndex &index) const
 
QList< QPair< int, int > > columnRanges (const QModelIndex &topIndex, const QModelIndex &bottomIndex) const
 
void select (const QModelIndex &start, const QModelIndex &stop, QItemSelectionModel::SelectionFlags command)
 
QPair< int, int > startAndEndColumns (const QRect &rect) const
 
void updateChildCount (const int parentItem, const int delta)
 
void paintAlternatingRowColors (QPainter *painter, QStyleOptionViewItem *option, int y, int bottom) const
 
void calcLogicalIndices (QList< int > *logicalIndices, QList< QStyleOptionViewItem::ViewItemPosition > *itemPositions, int left, int right) const
 
int widthHintForIndex (const QModelIndex &index, int hint, const QStyleOptionViewItem &option, int i) const
 
QRect visualRect (const QModelIndex &index) const override
 
QRect visualRect (const QModelIndex &index, RectRule rule) const
 
bool storeExpanded (const QPersistentModelIndex &idx)
 
bool isIndexExpanded (const QModelIndex &idx) const
 
bool isRowHidden (const QModelIndex &idx) const
 
bool isItemHiddenOrDisabled (int i) const
 
int above (int item) const
 
int below (int item) const
 
void invalidateHeightCache (int item) const
 
int accessibleTable2Index (const QModelIndex &index) const
 
int accessibleTree2Index (const QModelIndex &index) const
 
void updateIndentationFromStyle ()
 
void updateAccessibility ()
 
- Public Member Functions inherited from QAbstractItemViewPrivate
 QAbstractItemViewPrivate ()
 
virtual ~QAbstractItemViewPrivate ()
 
void init ()
 
virtual void rowsRemoved (const QModelIndex &parent, int start, int end)
 
virtual void rowsInserted (const QModelIndex &parent, int start, int end)
 
virtual void columnsInserted (const QModelIndex &parent, int start, int end)
 
virtual void layoutChanged ()
 
virtual void rowsMoved (const QModelIndex &source, int sourceStart, int sourceEnd, const QModelIndex &destination, int destinationStart)
 
virtual void columnsMoved (const QModelIndex &source, int sourceStart, int sourceEnd, const QModelIndex &destination, int destinationStart)
 
void headerDataChanged ()
 
void scrollerStateChanged ()
 
void delegateSizeHintChanged (const QModelIndex &index)
 
void fetchMore ()
 
bool shouldEdit (QAbstractItemView::EditTrigger trigger, const QModelIndex &index) const
 
bool shouldForwardEvent (QAbstractItemView::EditTrigger trigger, const QEvent *event) const
 
bool shouldAutoScroll (const QPoint &pos) const
 
void doDelayedItemsLayout (int delay=0)
 
void interruptDelayedItemsLayout () const
 
void updateGeometry ()
 
void startAutoScroll ()
 
void stopAutoScroll ()
 
bool droppingOnItself (QDropEvent *event, const QModelIndex &index)
 
QWidgeteditor (const QModelIndex &index, const QStyleOptionViewItem &options)
 
bool sendDelegateEvent (const QModelIndex &index, QEvent *event) const
 
bool openEditor (const QModelIndex &index, QEvent *event)
 
void updateEditorData (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 
void selectAllInEditor (QWidget *w)
 
QItemSelectionModel::SelectionFlags multiSelectionCommand (const QModelIndex &index, const QEvent *event) const
 
QItemSelectionModel::SelectionFlags extendedSelectionCommand (const QModelIndex &index, const QEvent *event) const
 
QItemSelectionModel::SelectionFlags contiguousSelectionCommand (const QModelIndex &index, const QEvent *event) const
 
virtual void selectAll (QItemSelectionModel::SelectionFlags command)
 
void setHoverIndex (const QPersistentModelIndex &index)
 
void checkMouseMove (const QPersistentModelIndex &index)
 
void checkMouseMove (const QPoint &pos)
 
QItemSelectionModel::SelectionFlags selectionBehaviorFlags () const
 
void releaseEditor (QWidget *editor, const QModelIndex &index=QModelIndex()) const
 
void executePostedLayout () const
 
void setDirtyRegion (const QRegion &visualRegion)
 
void scrollDirtyRegion (int dx, int dy)
 
void scrollContentsBy (int dx, int dy)
 
void updateDirtyRegion ()
 
void clearOrRemove ()
 
void checkPersistentEditorFocus ()
 
QPixmap renderToPixmap (const QModelIndexList &indexes, QRect *r) const
 
QPoint offset () const
 
const QEditorInfoeditorForIndex (const QModelIndex &index) const
 
bool hasEditor (const QModelIndex &index) const
 
QModelIndex indexForEditor (QWidget *editor) const
 
void addEditor (const QModelIndex &index, QWidget *editor, bool isStatic)
 
void removeEditor (QWidget *editor)
 
bool isAnimating () const
 
bool isIndexValid (const QModelIndex &index) const
 
bool isIndexSelectable (const QModelIndex &index) const
 
bool isIndexEnabled (const QModelIndex &index) const
 
virtual bool selectionAllowed (const QModelIndex &index) const
 
QPoint contentsOffset () const override
 
int delegateRefCount (const QAbstractItemDelegate *delegate) const
 
bool isPersistent (const QModelIndex &index) const
 
void doDelayedReset ()
 

Public Attributes

QHeaderViewheader
 
int indent
 
QList< QTreeViewItemviewItems
 
int lastViewedItem
 
int defaultItemHeight
 
bool uniformRowHeights
 
bool rootDecoration
 
bool itemsExpandable
 
bool sortingEnabled
 
bool expandsOnDoubleClick
 
bool allColumnsShowFocus
 
bool customIndent
 
QPair< int, int > leftAndRight
 
int current
 
bool spanning
 
QSet< QPersistentModelIndexexpandedIndexes
 
bool animationsEnabled
 
QSet< QPersistentModelIndexhiddenIndexes
 
QSet< QPersistentModelIndexspanningIndexes
 
int columnResizeTimerID
 
QList< int > columnsToUpdate
 
int autoExpandDelay
 
QBasicTimer openTimer
 
int hoverBranch
 
bool geometryRecursionBlock
 
bool hasRemovedItems
 
int treePosition
 
QMetaObject::Connection animationConnection
 
QMetaObject::Connection selectionmodelConnection
 
std::array< QMetaObject::Connection, 2 > modelConnections
 
std::array< QMetaObject::Connection, 5 > headerConnections
 
QMetaObject::Connection sortHeaderConnection
 
- Public Attributes inherited from QAbstractItemViewPrivate
QAbstractItemModelmodel
 
QPointer< QAbstractItemDelegateitemDelegate
 
QMap< int, QPointer< QAbstractItemDelegate > > rowDelegates
 
QMap< int, QPointer< QAbstractItemDelegate > > columnDelegates
 
QPointer< QItemSelectionModelselectionModel
 
QItemSelectionModel::SelectionFlag ctrlDragSelectionFlag
 
bool noSelectionOnMousePress
 
QAbstractItemView::SelectionMode selectionMode
 
QAbstractItemView::SelectionBehavior selectionBehavior
 
QEditorIndexHash editorIndexHash
 
QIndexEditorHash indexEditorHash
 
QSet< QWidget * > persistent
 
QWidgetcurrentlyCommittingEditor
 
QBasicTimer pressClosedEditorWatcher
 
QPersistentModelIndex lastEditedIndex
 
bool pressClosedEditor
 
bool waitForIMCommit
 
QPersistentModelIndex enteredIndex
 
QPersistentModelIndex pressedIndex
 
QPersistentModelIndex currentSelectionStartIndex
 
Qt::KeyboardModifiers pressedModifiers
 
QPoint pressedPosition
 
QPoint draggedPosition
 
bool pressedAlreadySelected
 
bool releaseFromDoubleClick
 
bool viewportEnteredNeeded
 
QAbstractItemView::State state
 
QAbstractItemView::State stateBeforeAnimation
 
QAbstractItemView::EditTriggers editTriggers
 
QAbstractItemView::EditTrigger lastTrigger
 
QPersistentModelIndex root
 
QPersistentModelIndex hover
 
bool tabKeyNavigation
 
QString keyboardInput
 
QElapsedTimer keyboardInputTime
 
bool autoScroll
 
QBasicTimer autoScrollTimer
 
int autoScrollMargin
 
int autoScrollCount
 
bool shouldScrollToCurrentOnShow
 
bool shouldClearStatusTip
 
bool alternatingColors
 
QSize iconSize
 
Qt::TextElideMode textElideMode
 
QRegion updateRegion
 
QPoint scrollDelayOffset
 
QBasicTimer updateTimer
 
QBasicTimer delayedEditing
 
QBasicTimer delayedAutoScroll
 
QBasicTimer delayedReset
 
QAbstractItemView::ScrollMode verticalScrollMode
 
QAbstractItemView::ScrollMode horizontalScrollMode
 
QItemSelection oldSelection
 
QModelIndex oldCurrent
 
bool currentIndexSet
 
bool wrapItemText
 
bool delayedPendingLayout
 
bool moveCursorUpdatedView
 
bool verticalScrollModeSet
 
bool horizontalScrollModeSet
 
std::array< QMetaObject::Connection, 14 > modelConnections
 
std::array< QMetaObject::Connection, 4 > scrollbarConnections
 

Detailed Description

Definition at line 49 of file qtreeview_p.h.

Member Enumeration Documentation

◆ RectRule

Enumerator
FullRow 
SingleSection 
AddRowIndicatorToFirstSection 

Definition at line 157 of file qtreeview_p.h.

Constructor & Destructor Documentation

◆ QTreeViewPrivate()

QTreeViewPrivate::QTreeViewPrivate ( )
inline

Definition at line 54 of file qtreeview_p.h.

◆ ~QTreeViewPrivate()

QTreeViewPrivate::~QTreeViewPrivate ( )
inline

Definition at line 65 of file qtreeview_p.h.

Member Function Documentation

◆ above()

int QTreeViewPrivate::above ( int item) const
inline

Definition at line 223 of file qtreeview_p.h.

References i, and item.

◆ accessibleTable2Index()

int QTreeViewPrivate::accessibleTable2Index ( const QModelIndex & index) const
inline

Definition at line 230 of file qtreeview_p.h.

References QSqlQueryModel::columnCount(), header(), and model.

+ Here is the call graph for this function:

◆ accessibleTree2Index()

int QTreeViewPrivate::accessibleTree2Index ( const QModelIndex & index) const

Definition at line 4044 of file qtreeview.cpp.

◆ adjustViewOptionsForIndex()

void QTreeViewPrivate::adjustViewOptionsForIndex ( QStyleOptionViewItem * option,
const QModelIndex & current ) const
overridevirtual

◆ below()

int QTreeViewPrivate::below ( int item) const
inline

Definition at line 225 of file qtreeview_p.h.

References i, and item.

◆ calcLogicalIndices()

void QTreeViewPrivate::calcLogicalIndices ( QList< int > * logicalIndices,
QList< QStyleOptionViewItem::ViewItemPosition > * itemPositions,
int left,
int right ) const

Definition at line 1560 of file qtreeview.cpp.

References QHeaderView::count(), header, QHeaderView::isSectionHidden(), isTreePosition(), QHeaderView::logicalIndex(), pos, and spanning.

Referenced by adjustViewOptionsForIndex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clearConnections()

void QTreeViewPrivate::clearConnections ( )

Definition at line 3103 of file qtreeview.cpp.

References animationConnection, connection, QObject::disconnect(), headerConnections, modelConnections, selectionmodelConnection, and sortHeaderConnection.

+ Here is the call graph for this function:

◆ collapse()

void QTreeViewPrivate::collapse ( int item,
bool emitSignal )

Definition at line 3184 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ columnAt()

int QTreeViewPrivate::columnAt ( int x) const

Definition at line 3768 of file qtreeview.cpp.

References header, and QHeaderView::logicalIndexAt().

+ Here is the call graph for this function:

◆ columnRanges()

QList< QPair< int, int > > QTreeViewPrivate::columnRanges ( const QModelIndex & topIndex,
const QModelIndex & bottomIndex ) const

Definition at line 3896 of file qtreeview.cpp.

References current, header, i, QHeaderView::isSectionHidden(), QHeaderView::logicalIndex(), qMax(), qMin(), ret, and QHeaderView::visualIndex().

Referenced by select().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ columnsAboutToBeRemoved()

void QTreeViewPrivate::columnsAboutToBeRemoved ( const QModelIndex & parent,
int start,
int end )
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 3343 of file qtreeview.cpp.

References QList< T >::clear(), QAbstractItemViewPrivate::columnsAboutToBeRemoved(), and viewItems.

+ Here is the call graph for this function:

◆ columnsRemoved()

void QTreeViewPrivate::columnsRemoved ( const QModelIndex & index,
int start,
int end )
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 3350 of file qtreeview.cpp.

References QAbstractItemViewPrivate::columnsRemoved(), and QAbstractItemViewPrivate::doDelayedItemsLayout().

+ Here is the call graph for this function:

◆ coordinateForItem()

int QTreeViewPrivate::coordinateForItem ( int item) const

Returns the viewport y coordinate for item.

Definition at line 3566 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(), pageUp(), and visualRect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ draggablePaintPairs()

QItemViewPaintPairs QTreeViewPrivate::draggablePaintPairs ( const QModelIndexList & indexes,
QRect * r ) const
overridevirtual

\reimp

We have a QTreeView way of knowing what elements are on the viewport

Reimplemented from QAbstractItemViewPrivate.

Definition at line 1431 of file qtreeview.cpp.

References QAbstractItemViewPrivate::draggablePaintPairs(), QSet< T >::isEmpty(), list, Q_ASSERT, and spanningIndexes.

+ Here is the call graph for this function:

◆ expand()

void QTreeViewPrivate::expand ( int item,
bool emitSignal )

Definition at line 3116 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(), updateAccessibility(), and viewItems.

Referenced by expandOrCollapseItemAtPos().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ expandOrCollapseItemAtPos()

bool QTreeViewPrivate::expandOrCollapseItemAtPos ( const QPoint & pos)

Definition at line 1378 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().

+ Here is the call graph for this function:

◆ firstVisibleItem()

int QTreeViewPrivate::firstVisibleItem ( int * offset = nullptr) const

Definition at line 3721 of file qtreeview.cpp.

References defaultItemHeight, i, itemHeight(), QAbstractItemView::ScrollPerItem, QList< T >::size(), uniformRowHeights, QAbstractItemViewPrivate::verticalScrollMode, and viewItems.

Referenced by lastVisibleItem().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasVisibleChildren()

bool QTreeViewPrivate::hasVisibleChildren ( const QModelIndex & parent) const

Definition at line 4018 of file qtreeview.cpp.

References QModelIndex::flags(), QAbstractItemModel::hasChildren(), hiddenIndexes, i, QSet< T >::isEmpty(), Qt::ItemNeverHasChildren, QAbstractItemViewPrivate::model, and QAbstractItemModel::rowCount().

Referenced by expandOrCollapseItemAtPos(), itemDecorationRect(), and layout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ indentationForItem()

int QTreeViewPrivate::indentationForItem ( int item) const

Definition at line 3533 of file qtreeview.cpp.

References QList< T >::at(), indent, item, QTreeViewItem::level, rootDecoration, QList< T >::size(), and viewItems.

Referenced by itemDecorationRect(), visualRect(), and widthHintForIndex().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initialize()

◆ insertViewItems()

void QTreeViewPrivate::insertViewItems ( int pos,
int count,
const QTreeViewItem & viewItem )

Definition at line 3151 of file qtreeview.cpp.

References QList< T >::data(), i, QList< T >::insert(), items, pos, QList< T >::size(), and viewItems.

Referenced by layout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ intersectedRect()

QRect QTreeViewPrivate::intersectedRect ( const QRect rect,
const QModelIndex & topLeft,
const QModelIndex & bottomRight ) const
overridevirtual

Reimplemented from QAbstractItemViewPrivate.

Definition at line 1410 of file qtreeview.cpp.

References QModelIndex::column(), QAbstractItemViewPrivate::executePostedLayout(), QAbstractItemModel::index(), isRowHidden(), QAbstractItemViewPrivate::model, QModelIndex::parent(), rect, QModelIndex::row(), SingleSection, and visualRect().

+ Here is the call graph for this function:

◆ invalidateHeightCache()

void QTreeViewPrivate::invalidateHeightCache ( int item) const
inline

Definition at line 227 of file qtreeview_p.h.

References item.

◆ isIndexExpanded()

bool QTreeViewPrivate::isIndexExpanded ( const QModelIndex & idx) const
inline

Definition at line 201 of file qtreeview_p.h.

References QModelIndex::flags(), and Qt::ItemNeverHasChildren.

Referenced by layout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isItemHiddenOrDisabled()

bool QTreeViewPrivate::isItemHiddenOrDisabled ( int i) const
inline

Definition at line 216 of file qtreeview_p.h.

References i.

Referenced by itemForKeyEnd(), itemForKeyHome(), pageDown(), and pageUp().

+ Here is the caller graph for this function:

◆ isRowHidden()

bool QTreeViewPrivate::isRowHidden ( const QModelIndex & idx) const
inline

Definition at line 209 of file qtreeview_p.h.

Referenced by intersectedRect(), and layout().

+ Here is the caller graph for this function:

◆ isTreePosition()

bool QTreeViewPrivate::isTreePosition ( int logicalIndex) const
inline

Definition at line 69 of file qtreeview_p.h.

Referenced by calcLogicalIndices(), itemDecorationAt(), visualRect(), and widthHintForIndex().

+ Here is the caller graph for this function:

◆ itemAtCoordinate()

int QTreeViewPrivate::itemAtCoordinate ( int coordinate) const

Returns the index of the view item at the given viewport coordinate.

See also
modelIndex()

Definition at line 3617 of file qtreeview.cpp.

References defaultItemHeight, itemHeight(), QAbstractItemView::ScrollPerPixel, QList< T >::size(), uniformRowHeights, QAbstractItemViewPrivate::verticalScrollMode, and viewItems.

Referenced by itemDecorationAt(), pageDown(), and pageUp().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ itemDecorationAt()

int QTreeViewPrivate::itemDecorationAt ( const QPoint & pos) const

Definition at line 3847 of file qtreeview.cpp.

References QAbstractItemViewPrivate::executePostedLayout(), header, QSet< T >::isEmpty(), isTreePosition(), itemAtCoordinate(), itemDecorationRect(), QHeaderView::logicalIndexAt(), modelIndex(), pos, and spanningIndexes.

Referenced by expandOrCollapseItemAtPos().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ itemDecorationRect()

QRect QTreeViewPrivate::itemDecorationRect ( const QModelIndex & index) const

Definition at line 3869 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ itemForKeyEnd()

int QTreeViewPrivate::itemForKeyEnd ( ) const

Definition at line 3525 of file qtreeview.cpp.

References isItemHiddenOrDisabled(), QList< T >::size(), and viewItems.

+ Here is the call graph for this function:

◆ itemForKeyHome()

int QTreeViewPrivate::itemForKeyHome ( ) const

Definition at line 3517 of file qtreeview.cpp.

References isItemHiddenOrDisabled(), QList< T >::size(), and viewItems.

+ Here is the call graph for this function:

◆ itemHeight()

int QTreeViewPrivate::itemHeight ( int item) const

Definition at line 3543 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(), layout(), updateScrollBars(), and visualRect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lastVisibleItem()

int QTreeViewPrivate::lastVisibleItem ( int firstVisual = -1,
int offset = -1 ) const

Definition at line 3750 of file qtreeview.cpp.

References firstVisibleItem(), i, itemHeight(), QAbstractItemViewPrivate::offset(), QList< T >::size(), viewItems, and viewport().

+ Here is the call graph for this function:

◆ layout()

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 3379 of file qtreeview.cpp.

References QList< T >::at(), QAbstractItemModel::canFetchMore(), current, defaultItemHeight, emit, QAbstractItemModel::fetchMore(), QAbstractItemModel::hasChildren(), hasVisibleChildren(), i, QAbstractItemModel::index(), insertViewItems(), isIndexExpanded(), isRowHidden(), QModelIndex::isValid(), item, itemHeight(), Qt::ItemNeverHasChildren, j, layout, QTreeViewItem::level, QAbstractItemViewPrivate::model, modelIndex(), QGraphicsItem::parentItem(), qScopeGuard(), removeViewItems(), QList< T >::resize(), QAbstractItemViewPrivate::root, QAbstractItemModel::rowCount(), QList< T >::size(), storeExpanded(), uniformRowHeights, viewItems, and viewport().

+ Here is the call graph for this function:

◆ logicalIndexForTree()

int QTreeViewPrivate::logicalIndexForTree ( ) const

Definition at line 1350 of file qtreeview.cpp.

References header, QHeaderView::logicalIndex(), and treePosition.

Referenced by itemDecorationRect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modelAboutToBeReset()

void QTreeViewPrivate::modelAboutToBeReset ( )

Definition at line 3338 of file qtreeview.cpp.

References QList< T >::clear(), and viewItems.

Referenced by QTreeView::setModel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ modelDestroyed()

void QTreeViewPrivate::modelDestroyed ( )
overridevirtual

Reimplemented from QAbstractItemViewPrivate.

Definition at line 1402 of file qtreeview.cpp.

References QList< T >::clear(), QAbstractItemViewPrivate::modelDestroyed(), and viewItems.

+ Here is the call graph for this function:

◆ modelIndex()

QModelIndex QTreeViewPrivate::modelIndex ( int i,
int column = 0 ) const

Definition at line 3710 of file qtreeview.cpp.

References QList< T >::at(), i, QTreeViewItem::index, ret, QModelIndex::sibling(), QList< T >::size(), and viewItems.

Referenced by collapse(), itemDecorationAt(), layout(), and select().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pageDown()

int QTreeViewPrivate::pageDown ( int item) const

Definition at line 3505 of file qtreeview.cpp.

References coordinateForItem(), i, isItemHiddenOrDisabled(), itemAtCoordinate(), QList< T >::size(), viewItems, and viewport().

+ Here is the call graph for this function:

◆ pageUp()

int QTreeViewPrivate::pageUp ( int item) const

Definition at line 3493 of file qtreeview.cpp.

References coordinateForItem(), i, isItemHiddenOrDisabled(), itemAtCoordinate(), QList< T >::size(), viewItems, and viewport().

+ Here is the call graph for this function:

◆ paintAlternatingRowColors()

void QTreeViewPrivate::paintAlternatingRowColors ( QPainter * painter,
QStyleOptionViewItem * option,
int y,
int bottom ) const

Definition at line 1358 of file qtreeview.cpp.

References QAbstractItemViewPrivate::alternatingColors, current, defaultItemHeight, QAbstractItemViewPrivate::itemDelegate, painter, QStyle::PE_PanelItemViewRow, QStyle::SH_ItemView_PaintAlternatingRowColorsForEmptyArea, QAbstractItemDelegate::sizeHint(), and viewport().

+ Here is the call graph for this function:

◆ removeViewItems()

void QTreeViewPrivate::removeViewItems ( int pos,
int count )

Definition at line 3160 of file qtreeview.cpp.

References QList< T >::data(), i, items, pos, QList< T >::remove(), QList< T >::size(), and viewItems.

Referenced by collapse(), and layout().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ select()

void QTreeViewPrivate::select ( const QModelIndex & start,
const QModelIndex & stop,
QItemSelectionModel::SelectionFlags command )

Definition at line 3943 of file qtreeview.cpp.

References QList< T >::append(), QSet< T >::begin(), columnRanges(), QSet< T >::end(), i, QAbstractItemModel::index(), QModelIndex::isValid(), it, QAbstractItemViewPrivate::model, modelIndex(), QModelIndex::parent(), qAbs(), QModelIndex::row(), selection, QModelIndex::sibling(), and viewIndex().

+ Here is the call graph for this function:

◆ sortIndicatorChanged()

void QTreeViewPrivate::sortIndicatorChanged ( int column,
Qt::SortOrder order )

Definition at line 4039 of file qtreeview.cpp.

References QAbstractItemViewPrivate::model.

Referenced by QTreeView::setSortingEnabled().

+ Here is the caller graph for this function:

◆ startAndEndColumns()

QPair< int, int > QTreeViewPrivate::startAndEndColumns ( const QRect & rect) const

Definition at line 4003 of file qtreeview.cpp.

References QHeaderView::count(), header, qMakePair(), qMax(), qMin(), rect, and QHeaderView::visualIndexAt().

+ Here is the call graph for this function:

◆ storeExpanded()

bool QTreeViewPrivate::storeExpanded ( const QPersistentModelIndex & idx)
inline

Definition at line 194 of file qtreeview_p.h.

Referenced by expand(), and layout().

+ Here is the caller graph for this function:

◆ updateAccessibility()

void QTreeViewPrivate::updateAccessibility ( )

Definition at line 3357 of file qtreeview.cpp.

Referenced by expand().

+ Here is the caller graph for this function:

◆ updateChildCount()

void QTreeViewPrivate::updateChildCount ( const int parentItem,
const int delta )

◆ updateIndentationFromStyle()

void QTreeViewPrivate::updateIndentationFromStyle ( )

Definition at line 4052 of file qtreeview.cpp.

References indent, and QStyle::PM_TreeViewIndentation.

Referenced by initialize().

+ Here is the caller graph for this function:

◆ updateScrollBars()

◆ viewIndex()

int QTreeViewPrivate::viewIndex ( const QModelIndex & index) const

Definition at line 3666 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(), select(), and visualRect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ visualRect() [1/2]

QRect QTreeViewPrivate::visualRect ( const QModelIndex & index) const
inlineoverridevirtual

Reimplemented from QAbstractItemViewPrivate.

Definition at line 164 of file qtreeview_p.h.

References visualRect().

Referenced by intersectedRect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ visualRect() [2/2]

QRect QTreeViewPrivate::visualRect ( const QModelIndex & index,
RectRule rule ) const
Returns
the visual rectangle at
Parameters
index,accordingto
rule.\list
  • SingleSection The return value matches the section, which index points to.
  • FullRow Return the rectangle of the entire row, no matter which section index points to.
  • AddRowIndicatorToFirstSection Like SingleSection. If \index points to the first section, add the row indicator and its margins. \endlist

Definition at line 1090 of file qtreeview.cpp.

References QList< T >::at(), coordinateForItem(), QAbstractItemViewPrivate::executePostedLayout(), FullRow, header, indentationForItem(), QAbstractItemViewPrivate::isIndexValid(), isTreePosition(), itemHeight(), QHeaderView::length(), rule, SingleSection, QTreeViewItem::spanning, spanning, viewIndex(), and viewItems.

+ Here is the call graph for this function:

◆ widthHintForIndex()

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 1616 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().

+ Here is the call graph for this function:

Member Data Documentation

◆ allColumnsShowFocus

bool QTreeViewPrivate::allColumnsShowFocus

Definition at line 182 of file qtreeview_p.h.

◆ animationConnection

QMetaObject::Connection QTreeViewPrivate::animationConnection

Definition at line 267 of file qtreeview_p.h.

Referenced by clearConnections(), and initialize().

◆ animationsEnabled

bool QTreeViewPrivate::animationsEnabled

Definition at line 192 of file qtreeview_p.h.

Referenced by collapse(), expand(), and initialize().

◆ autoExpandDelay

int QTreeViewPrivate::autoExpandDelay

Definition at line 246 of file qtreeview_p.h.

◆ columnResizeTimerID

int QTreeViewPrivate::columnResizeTimerID

Definition at line 242 of file qtreeview_p.h.

◆ columnsToUpdate

QList<int> QTreeViewPrivate::columnsToUpdate

Definition at line 243 of file qtreeview_p.h.

◆ current

int QTreeViewPrivate::current
mutable

◆ customIndent

bool QTreeViewPrivate::customIndent

Definition at line 183 of file qtreeview_p.h.

◆ defaultItemHeight

int QTreeViewPrivate::defaultItemHeight

◆ expandedIndexes

QSet<QPersistentModelIndex> QTreeViewPrivate::expandedIndexes

Definition at line 191 of file qtreeview_p.h.

Referenced by collapse().

◆ expandsOnDoubleClick

bool QTreeViewPrivate::expandsOnDoubleClick

Definition at line 181 of file qtreeview_p.h.

◆ geometryRecursionBlock

bool QTreeViewPrivate::geometryRecursionBlock

Definition at line 253 of file qtreeview_p.h.

◆ hasRemovedItems

bool QTreeViewPrivate::hasRemovedItems

Definition at line 256 of file qtreeview_p.h.

◆ header

◆ headerConnections

std::array<QMetaObject::Connection, 5> QTreeViewPrivate::headerConnections

Definition at line 270 of file qtreeview_p.h.

Referenced by clearConnections().

◆ hiddenIndexes

QSet<QPersistentModelIndex> QTreeViewPrivate::hiddenIndexes

Definition at line 207 of file qtreeview_p.h.

Referenced by hasVisibleChildren().

◆ hoverBranch

int QTreeViewPrivate::hoverBranch
mutable

Definition at line 250 of file qtreeview_p.h.

◆ indent

int QTreeViewPrivate::indent

◆ itemsExpandable

bool QTreeViewPrivate::itemsExpandable

Definition at line 179 of file qtreeview_p.h.

Referenced by expandOrCollapseItemAtPos().

◆ lastViewedItem

int QTreeViewPrivate::lastViewedItem
mutable

Definition at line 175 of file qtreeview_p.h.

Referenced by viewIndex().

◆ leftAndRight

QPair<int,int> QTreeViewPrivate::leftAndRight
mutable

Definition at line 186 of file qtreeview_p.h.

◆ modelConnections

std::array<QMetaObject::Connection, 2> QTreeViewPrivate::modelConnections

Definition at line 269 of file qtreeview_p.h.

Referenced by clearConnections().

◆ openTimer

QBasicTimer QTreeViewPrivate::openTimer

Definition at line 247 of file qtreeview_p.h.

◆ rootDecoration

bool QTreeViewPrivate::rootDecoration

Definition at line 178 of file qtreeview_p.h.

Referenced by indentationForItem(), and itemDecorationRect().

◆ selectionmodelConnection

QMetaObject::Connection QTreeViewPrivate::selectionmodelConnection

Definition at line 268 of file qtreeview_p.h.

Referenced by clearConnections().

◆ sortHeaderConnection

QMetaObject::Connection QTreeViewPrivate::sortHeaderConnection

Definition at line 271 of file qtreeview_p.h.

Referenced by clearConnections().

◆ sortingEnabled

bool QTreeViewPrivate::sortingEnabled

Definition at line 180 of file qtreeview_p.h.

Referenced by QTreeWidgetPrivate::dataChanged(), and QTreeWidgetPrivate::sort().

◆ spanning

bool QTreeViewPrivate::spanning
mutable

Definition at line 188 of file qtreeview_p.h.

Referenced by adjustViewOptionsForIndex(), calcLogicalIndices(), and visualRect().

◆ spanningIndexes

QSet<QPersistentModelIndex> QTreeViewPrivate::spanningIndexes

Definition at line 239 of file qtreeview_p.h.

Referenced by draggablePaintPairs(), and itemDecorationAt().

◆ treePosition

int QTreeViewPrivate::treePosition

Definition at line 259 of file qtreeview_p.h.

Referenced by logicalIndexForTree().

◆ uniformRowHeights

bool QTreeViewPrivate::uniformRowHeights

◆ viewItems


The documentation for this class was generated from the following files: